-
Notifications
You must be signed in to change notification settings - Fork 884
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
Add --help and --new-window flag and fix --version flag #6455
base: development
Are you sure you want to change the base?
Conversation
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.
This is working great for me!
suggestion (non-blocking): A non-recognized argument error might be a good idea for preventing an accidental app load from a typo if we don't mind slightly expanding the scope. It could be frustrating to type -version
and accidentally launch a window. E.g., Here's a similar error from nano
for reference:
nano: unrecognized option '--potato'
Type 'nano -h' for a list of available options.
The problem (at least on Linux) with validating arguments in this way is that Electron parses arguments like |
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.
Ah, I completely forgot about that. Here's how Codium handles this for a more similar example, where they show a warning but still continue to launch. Will approve now, as I'm not sure of not a fan of the effort to get this list of known options:
Warning: 'potato' is not in the list of known options, but still passed to Electron/Chromium.
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.
I haven't got around to testing this yet, but at least from the code it looks like --version
and --help
will only be usable if FreeTube is not currently running.
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Head branch was pushed to by a user without write access
e0f0d9a
FreeTube calls |
Add --help and --new-window flag and fix --version flag
Pull Request Type
Related issue
#4446
Description
This contains three commits. The first adds a
--new-window
argument. This argument causes a new window to be opened in an existing instance. If there is no existing instance, it creates a new instance. The second fixes the--version
flag that got broken by #2606. The third adds a--help
flag.Screenshots
Testing
The
--help
and--version
flags were (hopefully) trivial to test. Their output can be seen above. The scope of the modifications required for the--new-window
flag is also fairly small. I tested starting freetube both with and without the--new-window
flag and both with and without a url. It worked in all four cases.Desktop
Additional context