Skip to content

Commit

Permalink
Rename 'failsafe' to 'allow_extra_args'
Browse files Browse the repository at this point in the history
  • Loading branch information
dpino committed Apr 20, 2018
1 parent aa31d24 commit d35cdd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ end

function run(args)
local opts = { command='set-alarm-operator-state', with_path=false, is_config=false,
usage=show_usage, failsafe=true }
usage=show_usage, allow_extra_args=true }
local args, cdr = common.parse_command_line(args, opts)
local l_args = parse_args(cdr)
local response = common.call_leader(
Expand Down
4 changes: 2 additions & 2 deletions src/program/config/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local parse_command_line_opts = {
require_schema = { default=false },
is_config = { default=true },
usage = { default=show_usage },
failsafe = { default=false },
allow_extra_args = { default=false },
}

local function path_grammar(schema_name, path, is_config)
Expand Down Expand Up @@ -121,7 +121,7 @@ function parse_command_line(args, opts)
end
ret.value = parser(ret.value_str)
end
if not opts.failsafe and #args ~= 0 then err("too many arguments") end
if not opts.allow_extra_args and #args ~= 0 then err("too many arguments") end
return ret, args
end

Expand Down

0 comments on commit d35cdd5

Please sign in to comment.