I have been working on my scripts for user/group permissions today. This idea has been on my back burner for awhile. I'm sure others have done this before. I just haven't encountered them yet.
I was thinking of just trying to find the flags where they start a line and put everything in a string array until the next line that starts with a flag. Then I would just call the script with the command, a loop would match the flags and print the matches.
5 Comments
BuoyantCitrus@lemmy.ca · 15 pts · 3y
https://explainshell.com/
learnbyexample@programming.dev · 3 pts · 3y
Inspired by explainshell, I wrote a script (https://github.com/learnbyexample/command_help) to be used from the terminal itself. It is a bit buggy, but works well most of the time. For example:
inspxtr@lemmy.world · 2 pts · 3y
omg that is lovely. Kinda like https://regex101.com/ for regular expressions.
eager_eagle@lemmy.world · 1 pts · 3y
bitwolf@lemmy.one · 4 pts · 3y
I like to use cht.sh you it maps it's subdirectories to commands and you just curl it.
Eg:
curl cht.sh/catcurl cht.sh/grepphoenix591@lemmy.phoenix591.com · 2 pts · 3y
you're probably looking for getopt/getopts. one big difference between them is getopt handles --long options while getopt doesn't.
other example