Skip to content

Commit

Permalink
Release v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amireh committed Jan 12, 2016
1 parent 5d3c18f commit 374b0e1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lua_cliargs-3.0.rc-1.rockspec → lua_cliargs-3.0.rockspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package = "lua_cliargs"
version = "3.0.rc-1"
version = "3.0"
source = {
url = "git://github.com/amireh/lua_cliargs.git",
branch = "3.0"
Expand Down
4 changes: 2 additions & 2 deletions spec/cliargs_parsing_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("Testing cliargs library parsing commandlines", function()
it("tests required argument callback returning error", function()
cli:argument("ARG", "arg description", callback_fail)

local args, err = cli:parse({ "arg_val" })
local _, err = cli:parse({ "arg_val" })
assert.matches('bad argument for ARG', err)
end)

Expand Down Expand Up @@ -68,7 +68,7 @@ describe("Testing cliargs library parsing commandlines", function()
cli:set_name('myapp')
cli:splat("OPTARG", "optinoal arg description", nil, 1, callback_fail)

local args, err = cli:parse({ "opt_arg" })
local _, err = cli:parse({ "opt_arg" })
assert.matches('bad argument for OPTARG', err)
end)

Expand Down
6 changes: 3 additions & 3 deletions spec/features/argument_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe("cliargs - arguments", function()
it('works with a single argument', function()
cli:argument('PATH', 'path to a file')

local args, err = helpers.parse(cli, '/some/where')
local args = helpers.parse(cli, '/some/where')

assert.equal(args.PATH, '/some/where')
end)
Expand All @@ -64,14 +64,14 @@ describe("cliargs - arguments", function()
cli:argument('INPUT', 'path to the input file')
cli:argument('OUTPUT', 'path to the output file')

local args, err = helpers.parse(cli, '/some/where')
local _, err = helpers.parse(cli, '/some/where')
assert.matches('bad number of arguments', err)
end)

it('bails on too many arguments', function()
cli:argument('INPUT', 'path to the input file')

local args, err = helpers.parse(cli, 'foo bar')
local _, err = helpers.parse(cli, 'foo bar')

assert.matches('bad number of arguments', err)
end)
Expand Down
4 changes: 2 additions & 2 deletions spec/features/flag_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe("cliargs - flags", function()

context('given an unknown flag', function()
it('bails', function()
local res, err = helpers.parse(cli, '--asdf', true)
local _, err = helpers.parse(cli, '--asdf', true)
assert.matches('unknown', err)
end)
end)
Expand Down Expand Up @@ -131,7 +131,7 @@ describe("cliargs - flags", function()
end)

it('bails', function()
local res, err = helpers.parse(cli, '--no-quiet')
local _, err = helpers.parse(cli, '--no-quiet')
assert.matches('may not be negated', err)
end)
end)
Expand Down
6 changes: 3 additions & 3 deletions spec/features/option_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ describe("cliargs - options", function()

context('given an unknown option', function()
it('bails', function()
local args, err = helpers.parse(cli, '--asdf=jkl;', true)
local _, err = helpers.parse(cli, '--asdf=jkl;', true)
assert.matches('unknown', err)
end)
end)

it('bails if no value was passed', function()
local args, err = helpers.parse(cli, '-s')
local _, err = helpers.parse(cli, '-s')
assert.matches("option %-s requires a value to be set", err)
end)
end)
Expand Down Expand Up @@ -219,7 +219,7 @@ describe("cliargs - options", function()
return nil, ">>> bad argument <<<"
end)

local args, err = helpers.parse(cli, '-c lzma', true)
local _, err = helpers.parse(cli, '-c lzma', true)
assert.equal('>>> bad argument <<<', err)
end)
end)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/splatarg_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe("cliargs - splat arguments", function()
it('bails if more values were passed than acceptable', function()
cli:splat('SPLAT', 'foobar', nil, 2)

local args, err = helpers.parse(cli, 'a b c')
local _, err = helpers.parse(cli, 'a b c')
assert.matches("bad number of arguments", err)
end)
end)
Expand Down
2 changes: 1 addition & 1 deletion src/cliargs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ function cli:cleanup()
cli = nil
end

cli.VERSION = "3.0.rc-1"
cli.VERSION = "3.0"

return cli
2 changes: 0 additions & 2 deletions src/cliargs/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ function p.collect_results(cli_values, options)
else
return entry_values
end

return entry_values
end

local function write(entry, value)
Expand Down

0 comments on commit 374b0e1

Please sign in to comment.