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
Replace environment variable lookup by --gui / --cli flag #22
Comments
Hi, would something like this work for you?
|
Well, this works, but I thought of it as the default feature for recognizing wether the program is a gui or started by the gui (opposed to having a environment variable to determine it). IMO, it's a better default, since turning a CLI program into a GUI one disables the CLI use, except in case where the user of klask do things like the one you proposed. I think it would be quite easy to modify the app to include the desired flags, and useful (I repeat myself, I know) since a GUI and a CLI live in the same binary. I understand that Klask's raison-d'être is to turn CLIs into GUIs, but losing the CLI makes me a bit sad. I also understand that this isn't necessarily a feature used by all users. However, it would make Klask more appealing to me. Anyway, thanks for you dedication. Have a great day ! |
To be clear, I meant this as a crate-level feature, rather than a user-level one. |
Sorry if I came off as dismissive in my previous answer. Thanks for the interest in this library! |
Ok I get all of that. I agree, forcing CLI isn't a good idea, and adding options might be invasive. I would suggest the use of crate features for adding optional --cli flag rather than a --gui flag, or maybe using CLI flags to build GUI fields state ? Maybe it's a bad idea ? I don't really know, and I hope I gave you some ideas. I can't wait for clap v3 to come out so that I can use your crate ! Cheers |
I just don't really see the point. But I remember that at the beginning I have looked for a way to detect if the app was launched from a command line or if it was launched from a gui. I couldn't really find anything, but I might try again because that would be the best option in my opinion (you could use cli in the first case and launch a gui in the second). |
Thanks again for the work you've put into Klask.
I think that we should replace the environment variable
KLASK_CHILD_APP
by a --gui / --cli flag. This would allow to have only one binary for both graphical and command line interfaces.Cheers
The text was updated successfully, but these errors were encountered: