Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
admercs committed Jan 10, 2024
1 parent 3d605eb commit 25f3341
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,28 @@ function main()
args = add_example(args, "julia main.jl --input dir/file.txt --number 10 --verbose")
args = add_example(args, "julia main.jl --help")
args = parse_args(args)

# print the autogenerated usage/help message in yellow
help(args, color="yellow")

# overwrite the usage member with the `usage` string and print the help message in cyan
args.usage::String = usage
help(args, color="cyan")

# check boolean flags passed via command-line
get_value(args, "verbose") && println("Verbose mode enabled")
get_value(args, "v") && println("Verbose mode enabled")
get_value(args, "--help") && help(args, color="yellow")
get_value(args, "--help") && println("Help mode enabled")

# check values
has_key(args, "input") && println("Input file: ", get_value(args, "input"))
has_key(args, "number") && println("The number: ", get_value(args, "number"))

# we can override the usage statement with our own
args.usage::String = usage
help(args, color="cyan")

# use `set` to override command-line argument values
# use `set_value` to override defaults or values passed in via command-line
has_key(args, "help") && set_value(args, "help", true)
has_key(args, "help") && help(args, color="green")

# check if SHA-256 byte key exists and print it if it does
# check if SHA-256 hash 2-byte key exists and print it if it does
has_key(args, "help") && println("\nHash key: $(get_key(args, "help"))\n")

# DO SOMETHING AMAZING
Expand Down

2 comments on commit 25f3341

@admercs
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: Version 1.0.0 already exists

Please sign in to comment.