-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swap in structopt to get -h/--help #31
Conversation
Small PR to add the -h flag by switching the argument parsing to structopt.
I saw your post about hacktoberfest contributions being welcome. If this is in any way not ok please feel free to close right away. |
It's looking great from the diff! Thank you! I'll just run the checks and try it out. (If one of the checks fails it's likely my fault, I'll look into it in a moment.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reserde on structopt-for-h is 📦 v0.0.2 via 🦀 v1.55.0
❯ cargo run -- -h
Finished dev [unoptimized + debuginfo] target(s) in 0.66s
Running `target\debug\reserde.exe -h`
reserde 0.0.2
Transcode a self-describing format into a different format.
Currently supports Bencode, Bincode (--out only), CBOR, JSON (--pretty), TAML (--in only), XML, x-www-form-urlencoded
(as urlencoded) and YAML. All names are lowercase.
USAGE:
reserde.exe [FLAGS] [OPTIONS] --in <in-format> --out <out-format>
FLAGS:
--enum-bools case-insensitively convert unit variants with name `true` or `false` into booleans
-h, --help Prints help information
-p pretty-print (where supported)
-V, --version Prints version information
OPTIONS:
--if <in-file> where to read input from. Defaults to stdin
-i, --in <in-format> what to read [possible values: bencode, cbor, json, taml, urlencoded, xml, yaml]
--of <out-file> where to write output to. Defaults to stdout
-o, --out <out-format> what to write [possible values: bencode, bincode, cbor, json, urlencoded, xml, yaml]
-s <stringify>... stringify bytes and non-string value keys into strings where possible, possible values
are: utf8. (Tries encodings in the order specified.) [try with: --in bencode]
Perfect, thank you!
It incidentally also improved the error output a bit, if you pass no parameters at all.
This should make it easier for new users to discover how to use the tool.
It's quite late here, so I won't release a new version right now, but I'll put it on my tasks list for tomorrow. |
(I'm going to do a little repository gardening and assign you to both the original issue and this PR too, but there's no further action needed here. |
Add the short version of help by switching to structopt flag by switching the argument parsing to structopt to fix #30