Skip to content

Commit

Permalink
Replace warn() with @warn
Browse files Browse the repository at this point in the history
Closes #77
Closes #78
  • Loading branch information
carlobaldassi committed Mar 2, 2019
1 parent 859c988 commit 37e91f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ julia> using ArgParse

See also the examples in the [examples directory](examples).

## Changes in release 0.6.2

* Fix a remaining compatibility issue (`@warn`)

## Changes in release 0.6.1

* Testing infrastructure update, tiny docs fixes
Expand Down
9 changes: 5 additions & 4 deletions src/ArgParse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module ArgParse

using Compat
using Compat.Unicode
using Compat: @warn
using TextWrap

export
Expand All @@ -33,7 +34,7 @@ export

import Base: show, getindex, setindex!, haskey

@static if VERSION >= v"0.7.0"
@static if VERSION >= v"0.7.0"
@nospecialize # use only declared type signatures, helps with compile time
end

Expand Down Expand Up @@ -368,7 +369,7 @@ end
function warn_extra_opts(opts, valid_keys::Vector{Symbol})

for k in opts
k in valid_keys || warn("ignored option: $k")
k in valid_keys || @warn "ignored option: $k"
end
return true
end
Expand Down Expand Up @@ -801,7 +802,7 @@ macro add_arg_table(s, x...)
continue
else
# anything else: ignore, but issue a warning
warn("@add_arg_table: ignoring expression $y")
@warn "@add_arg_table: ignoring expression $y"
i += 1
end
end
Expand Down Expand Up @@ -1489,7 +1490,7 @@ function check_settings_can_use_symbols(settings::ArgParseSettings)
end
settings.suppress_warnings && return true
for f in args_table.fields
'-' in f.dest_name && warn("dest_name=$(f.dest_name) contains an hyphen; use the autofix_names=true setting to have it converted to an underscore")
'-' in f.dest_name && @warn "dest_name=$(f.dest_name) contains an hyphen; use the autofix_names=true setting to have it converted to an underscore"
end
return true
end
Expand Down

0 comments on commit 37e91f4

Please sign in to comment.