Debian Codegraph @

third_party/rust/clap/examples/tutorial_builder/04_02_validate.md

raw
1 ```console
2 $ 04_02_validate --help
3 A simple to use, efficient, and full-featured Command Line Argument Parser
4
5 Usage: 04_02_validate[EXE] <PORT>
6
7 Arguments:
8 <PORT> Network port to use
9
10 Options:
11 -h, --help Print help
12 -V, --version Print version
13
14 $ 04_02_validate 22
15 PORT = 22
16
17 $ 04_02_validate foobar
18 ? failed
19 error: invalid value 'foobar' for '<PORT>': `foobar` isn't a port number
20
21 For more information, try '--help'.
22
23 $ 04_02_validate 0
24 ? failed
25 error: invalid value '0' for '<PORT>': port not in range 1-65535
26
27 For more information, try '--help'.
28
29 ```