Skip to content

Commit

Permalink
Merge pull request #14 from kmsquire/feature/fix-add-argument-depreca…
Browse files Browse the repository at this point in the history
…tion

Fix add_argument deprecation
  • Loading branch information
kmsquire committed Feb 20, 2020
2 parents 5c9e8c7 + 451c05f commit 58ae542
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/argument_parser.jl
Expand Up @@ -37,7 +37,8 @@ end

function add_argument(args...; kwargs...)
@warn """add_argument(...) is deprecated and will be removed before ArgParse2 is registered.
Please use add_argument!(...)""" maxlog=1
Please use add_argument!(...)""" maxlog = 1
add_argument!(args...; kwargs...)
end

function add_argument!(parser::ArgumentParser, name_or_flags::String...; kwargs...)
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Expand Up @@ -414,6 +414,7 @@ end

parser = ArgumentParser(description="Test missing prog")
@test_logs (:warn, r"add_argument\(...\) is deprecated.*") add_argument(parser, "foo")
@test parse_args(parser, ["bar"]) === (foo = "bar",)
end

nothing

0 comments on commit 58ae542

Please sign in to comment.