Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently Enumerates the Results up to and including ( and on over ) n. Command line arguments don't vork.
- Loading branch information
0 parents
commit 056d9e2
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
#This reads in the command line arguments and sets options. | ||
proc commandLine {args} { | ||
global options | ||
set options(n) 10 | ||
set options(c) "vim" | ||
|
||
foreach {arg value} $args { | ||
if {[string equal $arg "-c"]} { | ||
set options(c) $value | ||
} elseif {[string equal $arg "-n"]} { | ||
set options(n) $value | ||
} else { | ||
puts "Don't Recognize Argument $arg" | ||
} | ||
} | ||
} | ||
|
||
commandLine $argv | ||
|
||
set COMMANDS [list] | ||
|
||
for {set i 0} {$i<$options(n)} {incr i} { | ||
if {[eof stdin]} { | ||
break | ||
} | ||
set line [gets stdin] | ||
lappend COMMANDS $line | ||
puts "$i- $line" | ||
} | ||
|
||
puts "Choice: " | ||
set r [gets stdin] | ||
|
||
puts "Choice was $r" |