Bug 1080302 (part 1) - Add support for --foo and /foo options where it's not already present. r=glandium.

This commit is contained in:
Nicholas Nethercote 2014-10-23 17:25:19 -07:00
parent 7178daef7e
commit bec174332a
5 changed files with 14 additions and 7 deletions

View File

@ -851,7 +851,9 @@ class RunProgram(MachCommandBase):
if not background and sys.platform == 'darwin':
args.append('-foreground')
if '-profile' not in params and '-P' not in params and not noprofile:
no_profile_option_given = \
all(p not in params for p in ['-profile', '--profile', '-P'])
if no_profile_option_given and not noprofile:
path = os.path.join(self.topobjdir, 'tmp', 'scratch_user')
if not os.path.isdir(path):
os.makedirs(path)

View File

@ -334,8 +334,8 @@ NS_IMPL_RELEASE_INHERITED(nsNativeAppSupportWin, nsNativeAppSupportBase)
void
nsNativeAppSupportWin::CheckConsole() {
for ( int i = 1; i < gArgc; i++ ) {
if ( strcmp( "-console", gArgv[i] ) == 0
||
if ( strcmp( "-console", gArgv[i] ) == 0 ||
strcmp( "--console", gArgv[i] ) == 0 ||
strcmp( "/console", gArgv[i] ) == 0 ) {
// Users wants to make sure we have a console.
// Try to allocate one.

View File

@ -327,10 +327,10 @@ int main(int argc, char *argv[])
bool removeApp = false;
for (int i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-profile")) {
if (!strcmp(argv[i], "-profile") || !strcmp(argv[i], "--profile")) {
isProfileOverridden = true;
}
else if (!strcmp(argv[i], "-remove")) {
else if (!strcmp(argv[i], "-remove") || !strcmp(argv[i], "--remove")) {
removeApp = true;
}
}

View File

@ -446,7 +446,9 @@ main(int argc, char* argv[])
// Check if the runtime was executed with the "-profile" argument
for (int i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-profile")) {
if (!strcmp(argv[i], "-profile") ||
!strcmp(argv[i], "--profile") ||
!strcmp(argv[i], "/profile")) {
isProfileOverridden = true;
break;
}

View File

@ -103,7 +103,10 @@ FrameworkView::LaunchActivated(ComPtr<ILaunchActivatedEventArgs>& aArgs, bool aS
int argc;
unsigned int length;
LPWSTR* argv = CommandLineToArgvW(data.GetRawBuffer(&length), &argc);
if (aStartup && argc == 2 && !wcsicmp(argv[0], L"-url")) {
if (aStartup && argc == 2 &&
(!wcsicmp(argv[0], L"-url") ||
!wcsicmp(argv[0], L"--url") ||
!wcsicmp(argv[0], L"/url"))) {
WindowsCreateString(argv[1], wcslen(argv[1]), &sActivationURI);
} else {
// Some other command line or this is not a startup.