Nuru icon indicating copy to clipboard operation
Nuru copied to clipboard

Improve command line argument handling

Open gekkowrld opened this issue 1 year ago • 4 comments

Handle arguments passed into the program through . Partially conforms to the GNU Argument Syntax: https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html

Flags are handled first before the arguments. If an flag passed is incorrect, then an error is returned. Flags handled as of now include: -h, --help: For printing help messages -m, --msaada: Kuonyesha usaidizi -v, --version, -t, --toleo: Showing the version Previous implementation supported flags like: --docs (should be an argument) -docs -version -msaada -help -toleo This flags do not conform to the GNU Argument Syntax. If any of this flag is passed, then the program prints the information and exits.

Arguments processed after the flags. Arguments supported as of now are that of filename. Any of the argument passed is treated as a filename and may fail if not one. Prevoius implementation allowed arguments like: version msaada help v This are not supported as of now.

Error messages are printed to stderr instead of stdout.

Signed-off-by: Gekko Wrld [email protected]

gekkowrld avatar Jun 11 '24 16:06 gekkowrld

Do not that we have to change the docs and readme, everywhere that references the previous flags. Will also have to add a -d, --docs.

AvicennaJr avatar Jun 11 '24 17:06 AvicennaJr

Actually I realized you removed the --docs flags. Have you tried that option? And why have it removed?

AvicennaJr avatar Jun 11 '24 17:06 AvicennaJr

Actually I realized you removed the --docs flags. Have you tried that option? And why have it removed?

Didn't realize it was there until now. But since you'll be changing some things, you can add it in.

gekkowrld avatar Jun 11 '24 17:06 gekkowrld

I'll be making a change in a few minutes before you merge.

*edit: No further changes

gekkowrld avatar Jun 11 '24 17:06 gekkowrld