New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implemetation of AtomCommandline to preserve args #1256
Conversation
Thanks for working on this. |
We don't need to replicate |
new_args.insert(new_args.end(), *it); | ||
args.swap(new_args); | ||
AtomCommandLine::Reset(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zcbenz then this hack would be present to stitch atom-shell swtich arguments from https://github.com/atom/atom-shell/blob/master/atom/app/atom_main_delegate.cc#L71 before sending to node::Environment
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we will use the original argv
, this hack will not be needed anymore.
6e8653a
to
177a59f
Compare
} | ||
|
||
current_process_commandline_ = new AtomCommandLine(NO_PROGRAM); | ||
current_process_commandline_->InitFromArgv(argc, argv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make AtomCommandLine's data members static
so we don't have to create a current_process_commandline_
instance.
d6695aa
to
a328dac
Compare
a328dac
to
399f47e
Compare
@zcbenz made the changes and added tests, havnt tested on windows though. Would be nice if someone did :) |
It works on Windows, thanks! |
implemetation of AtomCommandline to preserve args
Inital work for #1248 . @zcbenz If its desirable to have our own commandline class , then i can implement other methods from
base::commandline
for our needs and eliminate its usage. If this is too heavy for a trivial stuff, feel free to close it. would love to hear any better approaches :)EDIT: sorry didnt mean eliminate
base::commandLine
but justatomCommandLine
will wrap around it, so all commandLine calls to base will happen through this new class.