File tree 3 files changed +136
-288
lines changed
3 files changed +136
-288
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ This program is in the [examples directory](https://github.com/ryanmiville/clad/
24
24
``` gleam
25
25
import argv
26
26
import clad
27
+ import gleam/dynamic
27
28
import gleam/io
28
29
import gleam/list
29
30
import gleam/string
@@ -41,13 +42,14 @@ fn greet(args: Args) {
41
42
}
42
43
43
44
fn args_decoder() {
44
- use name <- clad.string (long_name: "name", short_name: "n")
45
- use count <- clad.int_with_default (
45
+ use name <- clad.arg (long_name: "name", short_name: "n", of: dynamic.string )
46
+ use count <- clad.arg_with_default (
46
47
long_name: "count",
47
48
short_name: "c",
49
+ of: dynamic.int,
48
50
default: 1,
49
51
)
50
- use scream <- clad.bool (long_name: "scream", short_name: "s")
52
+ use scream <- clad.toggle (long_name: "scream", short_name: "s")
51
53
clad.decoded(Args(name:, count:, scream:))
52
54
}
53
55
Original file line number Diff line number Diff line change 1
1
name = " clad"
2
- version = " 0.1.3 "
2
+ version = " 0.1.4 "
3
3
4
4
# Fill out these fields if you intend to generate HTML documentation or publish
5
5
# your project to the Hex package manager.
You can’t perform that action at this time.
0 commit comments