News for hackers. Stuff that matters.
Re:Gooey: Turn command line programs into GUI applications by jayvanguard on Sunday August 24, 2014 @12:43PM (#8218957)
Good idea. I wonder if anyone has done this for general unix command-line apps by parsing out the man pages on the fly. It probably wouldn't work for all programs but may be gnu style ones would be consistent enough.
Re:Gooey: Turn command line programs into GUI applications by eldelshell on Sunday August 24, 2014 @12:56PM (#8219004)
I too was expecting something like what you describe but by parsing -h --help output.
Re:Gooey: Turn command line programs into GUI applications by gioele on Sunday August 24, 2014 @02:10PM (#8219194)
The bash-completion script can deduce which options are supported by an application by parsing the output of --help and of usage lines. In Bash.

http://anonscm.debian.org/cgit/bash-completion/bash-completi...

Re:Gooey: Turn command line programs into GUI applications by DennisP on Sunday August 24, 2014 @02:37PM (#8219264)
Either way, it might be neat to do it dynamically, so command-line programs could be turned into guis live by typing "guify xyz".

The gui could have labels with the command options, and upon hitting enter they could close and send the command back to the command line, so you're learning the commands as you go.

Re:Gooey: Turn command line programs into GUI applications by davvid on Sunday August 24, 2014 @05:08PM (#8219679)
The Python "argcomplete" module[1] generates shell completions for any program that uses argparse, so it's certainly doable.

[1] https://github.com/kislyuk/argcomplete

Re:Gooey: Turn command line programs into GUI applications by vdm on Monday August 25, 2014 @12:21PM (#8222427)
> parsing out the man pages

https://github.com/idank/explainshell

Re:Gooey: Turn command line programs into GUI applications by jlarocco on Sunday August 24, 2014 @03:15PM (#8219371)
I've done something similar to this a few times, both in Python.

Once to create a TkInter GUI for an internal command line app, and once to wrap sg3_utils for use in Python scripts.

In general, I think it could "mostly work" a good portion of the time, but it'd be pretty difficult to get working 100% of the time without a lot of tweaking to the parser.

Re:Gooey: Turn command line programs into GUI applications by naranja on Sunday August 24, 2014 @02:37PM (#8219263)
The fish shell does this with an explicit command (fish_update_completions) and offers an awesome Tab completion in the current Github version
Re:Gooey: Turn command line programs into GUI applications by agumonkey on Sunday August 24, 2014 @03:37PM (#8219430)
Not far from that there's docopt who parses POSIX compliant arguments descriptions.
Re:Gooey: Turn command line programs into GUI applications by michaelmior on Sunday August 24, 2014 @03:48PM (#8219465)
Is there such a thing as POSIX-compliant argument descriptions? I know POSIX specifies some things about the format of options, but I didn't realize there was a formalized option description language.
Re:Gooey: Turn command line programs into GUI applications by euid on Sunday August 24, 2014 @04:08PM (#8219522)
Yes. IEEE Std. 1003.1 Utility Conventions

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_...

This is actually how Docopt happened (Vladimir Keleshev mentioned it in the PyCon UK 2012 talk).

Re:Gooey: Turn command line programs into GUI applications by michaelmior on Monday August 25, 2014 @09:11AM (#8221579)
Cool! Thanks for the reference :)
Re:Gooey: Turn command line programs into GUI applications by agumonkey on Sunday August 24, 2014 @04:58PM (#8219650)
Me neither, I thought docopt was a hardcoded fragile thing, until the author explains everything is almost perfectly defined.