Skip to content

Commit

Permalink
Updated Process.arguments to only return slice if arg count >= 2 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
txgruppi authored Apr 25, 2021
1 parent b82cf5a commit 0a5f583
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/module/os.wren
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Platform {

class Process {
// TODO: This will need to be smarter when wren supports CLI options.
static arguments { allArguments[2..-1] }
static arguments { allArguments.count >= 2 ? allArguments[2..-1] : [] }

foreign static allArguments
foreign static version
Expand Down
2 changes: 1 addition & 1 deletion src/module/os.wren.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static const char* osModuleSource =
"\n"
"class Process {\n"
" // TODO: This will need to be smarter when wren supports CLI options.\n"
" static arguments { allArguments[2..-1] }\n"
" static arguments { allArguments.count >= 2 ? allArguments[2..-1] : [] }\n"
"\n"
" foreign static allArguments\n"
" foreign static version\n"
Expand Down

0 comments on commit 0a5f583

Please sign in to comment.