Skip to content
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

Allow automatic UI/CLI toggle setting #33

Open
MidasLamb opened this issue Feb 25, 2022 · 3 comments
Open

Allow automatic UI/CLI toggle setting #33

MidasLamb opened this issue Feb 25, 2022 · 3 comments

Comments

@MidasLamb
Copy link

First of all, very cool lib!

It would be nice to have some way to decide whether or not the GUI should be launched based on some flag.
The usecase is that distributing a tool with klask will have the benefit of having a nice CLI in case people want to automate it, or use it in scripts, but people using it less often or who aren't comfortable with the CLI get greeted with a nice GUI.

I think it could be something along the lines of: if no additional arguments are present, start the gui, otherwise run the function in run_derived with the args parsed from what the program has been invoked with. This will however have the requirement that the program takes at least one required parameter, because otherwise you cannot distinguish between a CLI invocation and an invocation to start the GUI, but that is a trade-off tool-authors will have to consider then.

@MichalGniadek
Copy link
Owner

There has been some discussion about this here.
Combing CLI and GUI apps easily seems to be more important to people than I thought, but I'm not really sure what option would be the best way to do it.

@MidasLamb
Copy link
Author

Ah ok, I missed that! To give some more insight into why it would be useful (for me):
I often create some quick tools to automate certain parts of my job or the stack I'm working on (e.g. a simulator for a particular part/behaviour), and sometimes some less tech-savy members might also want/need to use it. Currently I always have to walk them through how to use it, since it's always a CLI.
If this option would exist, I would easily include Klask in all the tools, knowing that when a less savy team member double clicks it, they get greeted with a nice GUI, but the other developers can use it in their workflow and automate it easily with some scripts

@MichalGniadek
Copy link
Owner

Running the GUI if no parameters are passed in, might actually work well, I will have to prototype it.
For now, it's really easy to create two binaries, one for CLI and one for GUI, but I don't know if it meets your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants