2022-07-19 18:29:31 +00:00
|
|
|
**This requires enabling the [`derive` feature flag][crate::_features].**
|
2021-12-08 22:46:49 +00:00
|
|
|
|
2022-03-14 14:43:17 +00:00
|
|
|
Help:
|
2022-01-05 16:54:33 +00:00
|
|
|
```console
|
2022-03-14 14:37:52 +00:00
|
|
|
$ typed-derive --help
|
2022-09-07 16:03:55 +00:00
|
|
|
Usage: typed-derive[EXE] [OPTIONS]
|
2021-12-08 01:01:55 +00:00
|
|
|
|
2022-08-26 14:40:23 +00:00
|
|
|
Options:
|
2022-09-07 20:29:15 +00:00
|
|
|
-O <OPTIMIZATION> Implicitly using `std::str::FromStr`
|
|
|
|
-I <DIR> Allow invalid UTF-8 paths
|
|
|
|
--bind <BIND> Handle IP addresses
|
|
|
|
--sleep <SLEEP> Allow human-readable durations
|
|
|
|
-D <DEFINES> Hand-written parser for tuples
|
|
|
|
-h, --help Print help information
|
2022-01-05 16:54:33 +00:00
|
|
|
|
2022-03-14 14:43:17 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Optimization-level (number)
|
|
|
|
```console
|
|
|
|
$ typed-derive -O 1
|
2022-03-14 14:53:31 +00:00
|
|
|
Args { optimization: Some(1), include: None, bind: None, sleep: None, defines: [] }
|
2022-03-14 14:43:17 +00:00
|
|
|
|
|
|
|
$ typed-derive -O plaid
|
|
|
|
? failed
|
|
|
|
error: Invalid value "plaid" for '-O <OPTIMIZATION>': invalid digit found in string
|
|
|
|
|
2022-09-15 19:22:28 +00:00
|
|
|
For more information try '--help'
|
2022-03-14 14:43:17 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2022-03-14 14:45:43 +00:00
|
|
|
Include (path)
|
|
|
|
```console
|
|
|
|
$ typed-derive -I../hello
|
2022-03-14 14:53:31 +00:00
|
|
|
Args { optimization: None, include: Some("../hello"), bind: None, sleep: None, defines: [] }
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
IP Address
|
|
|
|
```console
|
|
|
|
$ typed-derive --bind 192.0.0.1
|
|
|
|
Args { optimization: None, include: None, bind: Some(192.0.0.1), sleep: None, defines: [] }
|
|
|
|
|
|
|
|
$ typed-derive --bind localhost
|
|
|
|
? failed
|
|
|
|
error: Invalid value "localhost" for '--bind <BIND>': invalid IP address syntax
|
|
|
|
|
2022-09-15 19:22:28 +00:00
|
|
|
For more information try '--help'
|
2022-03-14 14:49:46 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
Time
|
|
|
|
```console
|
|
|
|
$ typed-derive --sleep 10s
|
2022-03-14 14:53:31 +00:00
|
|
|
Args { optimization: None, include: None, bind: None, sleep: Some(Duration(10s)), defines: [] }
|
2022-03-14 14:49:46 +00:00
|
|
|
|
|
|
|
$ typed-derive --sleep forever
|
|
|
|
? failed
|
|
|
|
error: Invalid value "forever" for '--sleep <SLEEP>': expected number at 0
|
|
|
|
|
2022-09-15 19:22:28 +00:00
|
|
|
For more information try '--help'
|
2022-03-14 14:45:43 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2022-03-14 14:43:17 +00:00
|
|
|
Defines (key-value pairs)
|
|
|
|
```console
|
2022-03-14 14:37:52 +00:00
|
|
|
$ typed-derive -D Foo=10 -D Alice=30
|
2022-03-14 14:53:31 +00:00
|
|
|
Args { optimization: None, include: None, bind: None, sleep: None, defines: [("Foo", 10), ("Alice", 30)] }
|
2022-01-05 16:54:33 +00:00
|
|
|
|
2022-03-14 14:37:52 +00:00
|
|
|
$ typed-derive -D Foo
|
2021-12-08 01:01:55 +00:00
|
|
|
? failed
|
2022-02-07 19:28:48 +00:00
|
|
|
error: Invalid value "Foo" for '-D <DEFINES>': invalid KEY=value: no `=` found in `Foo`
|
2021-12-08 01:01:55 +00:00
|
|
|
|
2022-09-15 19:22:28 +00:00
|
|
|
For more information try '--help'
|
2022-01-05 16:54:33 +00:00
|
|
|
|
2022-03-14 14:37:52 +00:00
|
|
|
$ typed-derive -D Foo=Bar
|
2021-12-08 01:01:55 +00:00
|
|
|
? failed
|
2022-02-07 19:28:48 +00:00
|
|
|
error: Invalid value "Foo=Bar" for '-D <DEFINES>': invalid digit found in string
|
2021-12-08 01:01:55 +00:00
|
|
|
|
2022-09-15 19:22:28 +00:00
|
|
|
For more information try '--help'
|
2022-01-05 16:54:33 +00:00
|
|
|
|
2021-12-08 01:01:55 +00:00
|
|
|
```
|