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

Customize the handling of unrecognized options. #82

Open
oxinabox opened this issue Dec 2, 2019 · 0 comments
Open

Customize the handling of unrecognized options. #82

oxinabox opened this issue Dec 2, 2019 · 0 comments

Comments

@oxinabox
Copy link

oxinabox commented Dec 2, 2019

I would like to make it so that if a user passes in an unrecoginized option by name,
I can set it so it is just added, as a string (or maybe eval'd, or maybe handled with a user defined function?) to the returned dict.

This is not always desired, but i would like setting for it.
I can make a PR if I can get some pointers

using ArgParse
argparsesettings = ArgParseSettings()
@add_arg_table argparsesettings begin
    "--opt", "-o"
        help = "another option with an argument"
        arg_type = Int
        default = 0
end

parse_args(["--opt=4", "--bonus=71"], argparsesettings)

I would like it to be come back with:

Dict{Symbol,Any} with 1 entry:
  :opt => 4,
  :bonus=>"71"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant