Add -l
support for pwsh to match POSIX shell compatibility
This commit is contained in:
parent
3bfca6d0fa
commit
fb3a9098b5
1 changed files with 20 additions and 15 deletions
|
@ -173,28 +173,29 @@ namespace Microsoft.PowerShell
|
||||||
private const int MaxPipePathLengthMacOS = 104;
|
private const int MaxPipePathLengthMacOS = 104;
|
||||||
|
|
||||||
internal static string[] validParameters = {
|
internal static string[] validParameters = {
|
||||||
"version",
|
|
||||||
"nologo",
|
|
||||||
"noexit",
|
|
||||||
#if STAMODE
|
#if STAMODE
|
||||||
"sta",
|
"sta",
|
||||||
"mta",
|
"mta",
|
||||||
#endif
|
#endif
|
||||||
"noprofile",
|
|
||||||
"noninteractive",
|
|
||||||
"inputformat",
|
|
||||||
"outputformat",
|
|
||||||
"windowstyle",
|
|
||||||
"encodedcommand",
|
|
||||||
"configurationname",
|
|
||||||
"file",
|
|
||||||
"executionpolicy",
|
|
||||||
"command",
|
"command",
|
||||||
"settingsfile",
|
"configurationname",
|
||||||
|
"custompipename",
|
||||||
|
"encodedcommand",
|
||||||
|
"executionpolicy",
|
||||||
|
"file",
|
||||||
"help",
|
"help",
|
||||||
"workingdirectory",
|
"inputformat",
|
||||||
|
"loadprofile",
|
||||||
|
"noexit",
|
||||||
|
"nologo",
|
||||||
|
"noninteractive",
|
||||||
|
"noprofile",
|
||||||
|
"outputformat",
|
||||||
"removeworkingdirectorytrailingcharacter",
|
"removeworkingdirectorytrailingcharacter",
|
||||||
"custompipename"
|
"settingsfile",
|
||||||
|
"version",
|
||||||
|
"windowstyle",
|
||||||
|
"workingdirectory"
|
||||||
};
|
};
|
||||||
|
|
||||||
internal CommandLineParameterParser(PSHostUserInterface hostUI, string bannerText, string helpText)
|
internal CommandLineParameterParser(PSHostUserInterface hostUI, string bannerText, string helpText)
|
||||||
|
@ -742,6 +743,10 @@ namespace Microsoft.PowerShell
|
||||||
_noExit = true;
|
_noExit = true;
|
||||||
noexitSeen = true;
|
noexitSeen = true;
|
||||||
}
|
}
|
||||||
|
else if (MatchSwitch(switchKey, "loadprofile", "l"))
|
||||||
|
{
|
||||||
|
// do nothing as we load profile by default, but this is needed to be compatible with POSIX shell expectations
|
||||||
|
}
|
||||||
else if (MatchSwitch(switchKey, "noprofile", "nop"))
|
else if (MatchSwitch(switchKey, "noprofile", "nop"))
|
||||||
{
|
{
|
||||||
_skipUserInit = true;
|
_skipUserInit = true;
|
||||||
|
|
Loading…
Reference in a new issue