Skip to content

Commit

Permalink
Merge pull request #20 from greymd/pr/19
Browse files Browse the repository at this point in the history
Pr/19-update
  • Loading branch information
greymd authored Apr 19, 2020
2 parents f9897c8 + 177bb1e commit 3bb62fe
Show file tree
Hide file tree
Showing 35 changed files with 1,428 additions and 1,469 deletions.
39 changes: 19 additions & 20 deletions bin/addb.egi
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#!/usr/bin/env egison
(load-file "../lib/egzact/utils.egi")
(load-file "../lib/egzact/filters.egi")
--
-- This file has been auto-generated by egison-translator.
--

(define $main
(match-lambda (list string)
{
[(args-check-opts-str $opts $arg)
(execution print-each-line filter-plain opts arg (append stdin {arg}))]
[_ usage]
}))
loadFile "../lib/egzact/utils.egi"

(define $usage
(do {
(print "Usage: addb [OPTIONS] string")
option-usage
(print "tldr:")
(print " $ echo abc | addb ABC")
(print " abc")
(print " ABC")
}
))
loadFile "../lib/egzact/filters.egi"

main :=
\match as list string with
| argsCheckOptsStr $opts $arg ->
execution printEachLine filterPlain opts arg (stdin ++ [arg])
| _ -> usage

usage :=
do print "Usage: addb [OPTIONS] string"
optionUsage
print "tldr:"
print " $ echo abc | addb ABC"
print " abc"
print " ABC"
37 changes: 18 additions & 19 deletions bin/addl.egi
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#!/usr/bin/env egison
(load-file "../lib/egzact/utils.egi")
(load-file "../lib/egzact/filters.egi")
--
-- This file has been auto-generated by egison-translator.
--

(define $main
(match-lambda (list string)
{
[(args-check-opts-str $opts $arg)
(execution print-each-line filter-addl (append {"ifs=" "ofs="} opts) arg stdin)]
[_ usage]
}))
loadFile "../lib/egzact/utils.egi"

(define $usage
(do {
(print "Usage: addl [OPTIONS] string")
option-usage2
(print "tldr:")
(print " $ echo abc | addl ABC")
(print " ABCabc")
}
))
loadFile "../lib/egzact/filters.egi"

main :=
\match as list string with
| argsCheckOptsStr $opts $arg ->
execution printEachLine filterAddl (["ifs=", "ofs="] ++ opts) arg stdin
| _ -> usage

usage :=
do print "Usage: addl [OPTIONS] string"
optionUsage2
print "tldr:"
print " $ echo abc | addl ABC"
print " ABCabc"
36 changes: 17 additions & 19 deletions bin/addr.egi
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
#!/usr/bin/env egison
(load-file "../lib/egzact/utils.egi")
(load-file "../lib/egzact/filters.egi")
--
-- This file has been auto-generated by egison-translator.
--

(define $main
(match-lambda (list string)
{
[(args-check-opts-str $opts $arg)
(execution print-each-line filter-addr (append {"ifs=" "ofs="} opts) arg stdin)]
[_ usage]
}))
loadFile "../lib/egzact/utils.egi"

(define $usage
(do {
(print "Usage: addr [OPTIONS] string")
option-usage2
(print "tldr:")
(print " $ echo abc | addr ABC")
(print " abcABC")
}
))
loadFile "../lib/egzact/filters.egi"

main :=
\match as list string with
| argsCheckOptsStr $opts $arg ->
execution printEachLine filterAddr (["ifs=", "ofs="] ++ opts) arg stdin
| _ -> usage

usage :=
do print "Usage: addr [OPTIONS] string"
optionUsage2
print "tldr:"
print " $ echo abc | addr ABC"
print " abcABC"
39 changes: 19 additions & 20 deletions bin/addt.egi
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#!/usr/bin/env egison
(load-file "../lib/egzact/utils.egi")
(load-file "../lib/egzact/filters.egi")
--
-- This file has been auto-generated by egison-translator.
--

(define $main
(match-lambda (list string)
{
[(args-check-opts-str $opts $arg)
(execution print-each-line filter-plain opts arg (append {arg} stdin))]
[_ usage]
}))
loadFile "../lib/egzact/utils.egi"

(define $usage
(do {
(print "Usage: addt [OPTIONS] string")
option-usage
(print "tldr:")
(print " $ echo abc | addt ABC")
(print " ABC")
(print " abc")
}
))
loadFile "../lib/egzact/filters.egi"

main :=
\match as list string with
| argsCheckOptsStr $opts $arg ->
execution printEachLine filterPlain opts arg ([arg] ++ stdin)
| _ -> usage

usage :=
do print "Usage: addt [OPTIONS] string"
optionUsage
print "tldr:"
print " $ echo abc | addt ABC"
print " ABC"
print " abc"
47 changes: 23 additions & 24 deletions bin/comb.egi
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
#!/usr/bin/env egison
(load-file "../lib/egzact/utils.egi")
(load-file "../lib/egzact/filters.egi")
--
-- This file has been auto-generated by egison-translator.
--

(define $main
(match-lambda (list string)
{
[(args-check-opts-num $opts $num)
(execution print-each-line filter-comb opts (read num) stdin)]
[_ usage]
}))
loadFile "../lib/egzact/utils.egi"

(define $usage
(do {
(print "Usage: comb [OPTIONS] number")
option-usage
(print "tldr:")
(print " $ echo A B C D | comb 2")
(print " A B")
(print " A C")
(print " B C")
(print " A D")
(print " B D")
(print " C D")
}
))
loadFile "../lib/egzact/filters.egi"

main :=
\match as list string with
| argsCheckOptsNum $opts $num ->
execution printEachLine filterComb opts (read num) stdin
| _ -> usage

usage :=
do print "Usage: comb [OPTIONS] number"
optionUsage
print "tldr:"
print " $ echo A B C D | comb 2"
print " A B"
print " A C"
print " B C"
print " A D"
print " B D"
print " C D"
61 changes: 28 additions & 33 deletions bin/conv.egi
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
#!/usr/bin/env egison
(load-file "../lib/egzact/utils.egi")
(load-file "../lib/egzact/filters.egi")
--
-- This file has been auto-generated by egison-translator.
--

(define $main
(match-lambda (list string) {
; each line mode
[<cons ,"each" (args-check-opts-num $opts $arg)>
(execution print-each-line filter-conv-each opts (num-validation arg) stdin)]
[<cons ,"each" (args-check-opts $opts)>
(execution print-each-line filter-conv-each opts 1 stdin)]
loadFile "../lib/egzact/utils.egi"

; stream mode
[(args-check-opts-num $opts $arg)
(execution print-whole-input filter-conv opts (num-validation arg) stdin)]
[(args-check-opts $opts)
(execution print-whole-input filter-conv opts 1 stdin)]
loadFile "../lib/egzact/filters.egi"

[_ usage]
}))
main :=
\match as list string with
| #"each" :: argsCheckOptsNum $opts $arg ->
execution printEachLine filterConvEach opts (numValidation arg) stdin
| #"each" :: argsCheckOpts $opts ->
execution printEachLine filterConvEach opts 1 stdin
| argsCheckOptsNum $opts $arg ->
execution printWholeInput filterConv opts (numValidation arg) stdin
| argsCheckOpts $opts -> execution printWholeInput filterConv opts 1 stdin
| _ -> usage

(define $usage
(do {
(print "Usage: conv [OPTIONS] [number]")
(print " conv each [OPTIONS] [number]")
(print "Description:")
(print " With `each`, it reads & prints results for each line.")
option-usage
(print "")
(print "tldr:")
(print " $ echo A B C D E | conv 2")
(print " A B")
(print " B C")
(print " C D")
(print " D E")
}
))
usage :=
do print "Usage: conv [OPTIONS] [number]"
print " conv each [OPTIONS] [number]"
print "Description:"
print " With `each`, it reads & prints results for each line."
optionUsage
print ""
print "tldr:"
print " $ echo A B C D E | conv 2"
print " A B"
print " B C"
print " C D"
print " D E"
61 changes: 30 additions & 31 deletions bin/crops.egi
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
#!/usr/bin/env egison
(load-file "../lib/egzact/utils.egi")
(load-file "../lib/egzact/filters.egi")
--
-- This file has been auto-generated by egison-translator.
--

(define $main
(match-lambda (list string)
{
[(args-check-opts-str $opts $arg)
(execution print-each-line filter-crops (append {"ifs=" "ofs="} opts) arg stdin)]
[_ usage]
}))
loadFile "../lib/egzact/utils.egi"

(define $usage
(do {
(print "Usage: crops [OPTIONS] string")
option-usage2
(print "tldr:")
(print " $ echo 1110100110 | crops \"1.*1\"")
(print " 11")
(print " 111")
(print " 11101")
(print " 1101")
(print " 101")
(print " 11101001")
(print " 1101001")
(print " 101001")
(print " 1001")
(print " 111010011")
(print " 11010011")
(print " 1010011")
(print " 10011")
}
))
loadFile "../lib/egzact/filters.egi"

main :=
\match as list string with
| argsCheckOptsStr $opts $arg ->
execution printEachLine filterCrops (["ifs=", "ofs="] ++ opts) arg stdin
| _ -> usage

usage :=
do print "Usage: crops [OPTIONS] string"
optionUsage2
print "tldr:"
print " $ echo 1110100110 | crops \"1.*1\""
print " 11"
print " 111"
print " 11101"
print " 1101"
print " 101"
print " 11101001"
print " 1101001"
print " 101001"
print " 1001"
print " 111010011"
print " 11010011"
print " 1010011"
print " 10011"
44 changes: 21 additions & 23 deletions bin/cycle.egi
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
#!/usr/bin/env egison
(load-file "../lib/egzact/utils.egi")
(load-file "../lib/egzact/filters.egi")
--
-- This file has been auto-generated by egison-translator.
--

(define $main
(match-lambda (list string)
{
[(args-check-opts $opts)
(execution print-each-line filter-cycle opts [] stdin)]
[_ usage]
}))
loadFile "../lib/egzact/utils.egi"

(define $usage
(do {
(print "Usage: cycle [OPTIONS]")
option-usage
(print "tldr:")
(print " $ echo A B C D E | cycle")
(print " A B C D E")
(print " B C D E A")
(print " C D E A B")
(print " D E A B C")
(print " E A B C D")
}
))
loadFile "../lib/egzact/filters.egi"

main :=
\match as list string with
| argsCheckOpts $opts -> execution printEachLine filterCycle opts () stdin
| _ -> usage

usage :=
do print "Usage: cycle [OPTIONS]"
optionUsage
print "tldr:"
print " $ echo A B C D E | cycle"
print " A B C D E"
print " B C D E A"
print " C D E A B"
print " D E A B C"
print " E A B C D"
Loading

0 comments on commit 3bb62fe

Please sign in to comment.