Skip to content

Customize the handling of unrecognized options. #82

Open
@oxinabox

Description

@oxinabox

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions