I'm trying to make some sort of GUI for the zsh/bash terminal, just as a fun learning project, but most commands in zsh/bash need you to put in some sort of extra input, alongside just the command. Is there a way to get this info and parse it with any programming language, so I can get the user to give all the input needed without them needing to know how the command works (they will likely need to know a little, though)? Here's what I've found so far:
- I can get all the execs from usr/bin, and open their hex.
- I can find this location using the which command.
- I think there is a tool in the same location that can read the hex? (debinhex.pl)
- Some commands have a help command, but they all work differently.
--help
, which then prints a usage summary, but if there is a program in /usr/bin which does not follow this guideline, you are out of luck. Even worse, you are on a Mac, and the GNU tools are not installed there by default (they can be installed via homebrew), so you won't even have much success with --help either. You could of course fetch the man page, but nobody guarantees the existence of a man page for a certain program.man COMMAND
, but there is of course no guarantee for the existence of such a page. Furthermore, if you have different versions of a program on your computer, you have to make sure to call up the matching man-page.