Skip to content

Commit

Permalink
getopt: skip if arg is $null
Browse files Browse the repository at this point in the history
  • Loading branch information
r15ch13 committed Sep 15, 2018
1 parent 5f0c8cf commit f2d9f0d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/getopt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function getopt($argv, $shortopts, $longopts) {

for($i = 0; $i -lt $argv.length; $i++) {
$arg = $argv[$i]
if($null -eq $arg) { continue }
# don't try to parse array arguments
if($arg -is [array]) { $rem += ,$arg; continue }
if($arg -is [int]) { $rem += $arg; continue }
Expand Down

0 comments on commit f2d9f0d

Please sign in to comment.