bugfix for printing none
This commit is contained in:
3
cli.carp
3
cli.carp
@@ -88,7 +88,8 @@ unset.")
|
|||||||
(match @t
|
(match @t
|
||||||
(Integer i) (str i)
|
(Integer i) (str i)
|
||||||
(Floating f) (str f)
|
(Floating f) (str f)
|
||||||
(Str s) (str s)))
|
(Str s) (str s)
|
||||||
|
(None) @"none"))
|
||||||
|
|
||||||
(defn to-int [x]
|
(defn to-int [x]
|
||||||
(match x
|
(match x
|
||||||
|
@@ -3,8 +3,11 @@
|
|||||||
(defn main []
|
(defn main []
|
||||||
(let [p (=> (CLI.new @"My super cool tool!")
|
(let [p (=> (CLI.new @"My super cool tool!")
|
||||||
(CLI.add &(CLI.int "flag" "f" "my flag" true))
|
(CLI.add &(CLI.int "flag" "f" "my flag" true))
|
||||||
(CLI.add &(CLI.str "thing" "t" "my thing" false @"hi" &[@"a" @"b" @"hi"])))]
|
(CLI.add &(CLI.str "thing" "t" "my thing" false @"hi" &[@"a" @"b" @"hi"]))
|
||||||
|
(CLI.add &(CLI.str "other" "o" "my thing" false)))]
|
||||||
(match (CLI.parse &p)
|
(match (CLI.parse &p)
|
||||||
(Result.Success flags)
|
(Result.Success flags)
|
||||||
(println* &(str &(Map.get &flags "flag")) " " &(str &(Map.get &flags "thing")))
|
(println*
|
||||||
|
&(str &(Map.get &flags "flag")) " " &(str &(Map.get &flags "thing"))
|
||||||
|
" " &(str &(Map.get &flags "other")))
|
||||||
(Result.Error msg) (do (IO.errorln &msg) (CLI.usage &p)))))
|
(Result.Error msg) (do (IO.errorln &msg) (CLI.usage &p)))))
|
||||||
|
Reference in New Issue
Block a user