Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve command line argument handling #87

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jun 11, 2024

  1. fix: Improve command line argument handling

    Handle arguments passed into the program through <stdin>.
    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 committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    b09c853 View commit details
    Browse the repository at this point in the history