Add mul and echo utilities
This commit is contained in:
parent
dcfdb290f7
commit
3b5369fb21
5 changed files with 15 additions and 1 deletions
BIN
echo
Executable file
BIN
echo
Executable file
Binary file not shown.
8
echo.nim
Normal file
8
echo.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import cligen, sequtils
|
||||
|
||||
proc main(strings:seq[string], newline=true) =
|
||||
if newline: writeLine(stdout, strings.foldl(a & b))
|
||||
else: write(stdout, strings.foldl(a & b))
|
||||
flushFile(stdout)
|
||||
|
||||
dispatch(main)
|
||||
BIN
mul
Executable file
BIN
mul
Executable file
Binary file not shown.
6
mul.nim
Normal file
6
mul.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import cligen, sequtils
|
||||
|
||||
proc main(integers:seq[int]) =
|
||||
echo integers.foldl(a * b)
|
||||
|
||||
dispatch(main)
|
||||
|
|
@ -6,4 +6,4 @@ license = "Unlicense"
|
|||
|
||||
requires "nim >= 0.19.0"
|
||||
requires "cligen >= 0.9.19"
|
||||
bin = @["add", "false", "seq", "sleep", "true"]
|
||||
bin = @["add", "echo", "false", "mul", "seq", "sleep", "true"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue