Improve command line argument handling
Handle arguments passed into the program through
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]
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.
Actually I realized you removed the --docs flags. Have you tried that option? And why have it removed?
Actually I realized you removed the
--docsflags. 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.
I'll be making a change in a few minutes before you merge.
*edit: No further changes