Skip to content

Commit

Permalink
bugfix: resty: options did not pass to the user Lua script unless "--…
Browse files Browse the repository at this point in the history
…" was intentionally specified. thanks neomantra for the report in #3.
  • Loading branch information
agentzh committed Jul 2, 2015
1 parent 2a8bfb7 commit dbcb6b4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resty
Expand Up @@ -14,7 +14,7 @@ our $VERSION = 0.02;
use File::Spec ();
use FindBin ();
use List::Util qw( max );
use Getopt::Long qw( GetOptions :config no_ignore_case);
use Getopt::Long qw( GetOptions :config no_ignore_case require_order);
use File::Temp qw( tempdir );
use POSIX qw( WNOHANG );

Expand Down
36 changes: 36 additions & 0 deletions t/resty/user-args.t
Expand Up @@ -125,3 +125,39 @@ arg 5: ]==2!]
arg 6: \[=\[]=]$
--- err
=== TEST 6: user options
--- args: --help
--- src
print("arg 0: ", arg[0])
print("arg 1: ", arg[1])
print("arg 2: ", arg[2])
print("arg 3: ", arg[3])
--- out_like chop
^arg 0: .*?/tmp/\S+?\.lua
arg 1: --help
arg 2:
arg 3:
--- err
=== TEST 7: user options (--)
--- args: -- --help
--- src
print("arg 0: ", arg[0])
print("arg 1: ", arg[1])
print("arg 2: ", arg[2])
print("arg 3: ", arg[3])
--- out_like chop
^arg 0: .*?/tmp/\S+?\.lua
arg 1: --
arg 2: --help
arg 3:
--- err

0 comments on commit dbcb6b4

Please sign in to comment.