diff --git a/lua_cliargs-3.0.rc-1.rockspec b/lua_cliargs-3.0.rockspec similarity index 98% rename from lua_cliargs-3.0.rc-1.rockspec rename to lua_cliargs-3.0.rockspec index a60f6b3..c12ddb9 100644 --- a/lua_cliargs-3.0.rc-1.rockspec +++ b/lua_cliargs-3.0.rockspec @@ -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" diff --git a/spec/cliargs_parsing_spec.lua b/spec/cliargs_parsing_spec.lua index 86dd9f9..da90934 100644 --- a/spec/cliargs_parsing_spec.lua +++ b/spec/cliargs_parsing_spec.lua @@ -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) @@ -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) diff --git a/spec/features/argument_spec.lua b/spec/features/argument_spec.lua index c98261d..ee8b9fe 100644 --- a/spec/features/argument_spec.lua +++ b/spec/features/argument_spec.lua @@ -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) @@ -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) diff --git a/spec/features/flag_spec.lua b/spec/features/flag_spec.lua index e11a19a..ca829ed 100644 --- a/spec/features/flag_spec.lua +++ b/spec/features/flag_spec.lua @@ -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) @@ -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) diff --git a/spec/features/option_spec.lua b/spec/features/option_spec.lua index dab7135..4bbb1ed 100644 --- a/spec/features/option_spec.lua +++ b/spec/features/option_spec.lua @@ -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) @@ -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) diff --git a/spec/features/splatarg_spec.lua b/spec/features/splatarg_spec.lua index 9a514e0..79e9216 100644 --- a/spec/features/splatarg_spec.lua +++ b/spec/features/splatarg_spec.lua @@ -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) diff --git a/src/cliargs.lua b/src/cliargs.lua index 6ca2625..9e6dbcc 100644 --- a/src/cliargs.lua +++ b/src/cliargs.lua @@ -27,6 +27,6 @@ function cli:cleanup() cli = nil end -cli.VERSION = "3.0.rc-1" +cli.VERSION = "3.0" return cli \ No newline at end of file diff --git a/src/cliargs/parser.lua b/src/cliargs/parser.lua index a1bcb0d..d3864a6 100644 --- a/src/cliargs/parser.lua +++ b/src/cliargs/parser.lua @@ -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)