Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Apr 4, 2017
1 parent c456e5d commit db51941
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/counted.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Try: counted -vvvvvvvvvv
counted this.txt that.txt
"""

import strutils
import strutils, unicode
import docopt


let args = docopt(doc)
echo args

if args["-v"]:
echo capitalize(repeat("very ", args["-v"].len - 1) & "verbose")
echo unicode.capitalize(repeat("very ", args["-v"].len - 1) & "verbose")

for path in @(args["--path"]):
echo read_file(path)
6 changes: 3 additions & 3 deletions examples/cycle.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ if not infinite:

var interval = 0
if args["--interval"]:
interval = round(parse_float($args["--interval"])*1000)
interval = to_int(parse_float($args["--interval"])*1000)

while true:
for s in @(args["<what>"]):
echo s

if interval > 0:
sleep interval

if not infinite:
dec n
if n <= 0:
Expand Down

0 comments on commit db51941

Please sign in to comment.