Hacker News new | ask | show | jobs
by nathanfig 920 days ago
I would love something that could do the reverse.
3 comments

I would like to be able to use a gui to set up parameter sweeps based on info pulled from argparse and then convert back to a shell script that runs and saves the output sensibly.
I'm trying to solve the part of the problem that generates the output, the argparse part would not be that hard to write.

https://github.com/blooop/bencher/tree/main

Not quite; turn any GUI application into a Python command line program.
This feels maybe possible with QT. Since the inputs are all defined in code.
A WYSIWYG editor that spits out a CLI you mean? That would pretty neat, though I think would necessarily be kind of constrained. I wonder who has tried that approach, I can't think of any examples
Actually, something like a "zotero for argparse" would be cool. Where you enter arguments, their type, help string, defaults etc in a gui and then you can check the ones you need for a given python script and copy the relevant python code into your paste buffer.

I don't think it would be a massive time saver however what I usually do now is find some previous script that had similar arguments and copy them, and then copy-paste-edit to add new arguments.

The other advantage is you could enter the arguments agnostically and export as whatever language you're working in.

http://docopt.org/

Not quite what you asked for, but close: type example invocations to generate the CLI, and just pull the arguments from a dictionary at runtime.

Chatgpt soon probably!
how? you're going to modify the binary so that it can accept command line parameters? or clone the GUI's functionality in a CLI? that's akin to just creating the application from scratch.