Skip to content

Commit

Permalink
fix bug when process '--' argument
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhong Yin <[email protected]>
  • Loading branch information
tcler committed Apr 27, 2018
1 parent 83abecd commit 3cdeaf9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions getOpt-3.0/getOpt.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ proc ::getOpt::argparse {optionList argvVar optVar optArgVar} {
return $::getOpt::flag(NOTOPT)
}
if {$rarg in {--}} {
set optArg [lrange $argv 1 end]
set argv [list]
return $::getOpt::flag(NOTOPT)
set argv [lrange $argv 1 end]
return $::getOpt::flag(END)
}

set argv [lrange $argv 1 end]
Expand Down Expand Up @@ -227,7 +226,8 @@ proc ::getOpt::getOptions {optLists argv validOptionVar invalidOptionVar notOpti
#unknown options
set invalidOption($opt) "unkown options"
} elseif {$ret == $::getOpt::flag(END)} {
#end of nargv
#end of nargv or get --
set notOption [concat $notOption $nargv]
break
}
}
Expand Down

0 comments on commit 3cdeaf9

Please sign in to comment.