Commit 7af04aca94b0b450ce35a68137f2e67f0f3b7e4a

Authored by Göran Krampe
1 parent 7be5e09d

Exported parseArguments for easier testing

Showing 1 changed file with 2 additions and 2 deletions
lapp.nim
... ... @@ -220,7 +220,7 @@ proc closeFiles() {.noconv.} =
220 220 if nfiles == 0: return
221 221 for i in 1..nfiles: files[i].close()
222 222  
223   -proc parseArguments(usage: string, args: seq[string]): Table[string,PValue] =
  223 +proc parseArguments*(usage: string, args: seq[string]): Table[string,PValue] =
224 224 var
225 225 vars = initTable[string,PValue]()
226 226 n = len(args) - 1
... ... @@ -360,7 +360,7 @@ proc parse*(usage: string): Table[string,PValue] =
360 360  
361 361 when isMainModule:
362 362 var args = parse"""
363   - head [flags] [file1, file2 ...] [outfile]
  363 + head [flags] file [out]
364 364 -n: (default 10) number of lines
365 365 -v,--verbose: (bool...) verbosity level
366 366 -a,--alpha useless parm
... ...