-
Notifications
You must be signed in to change notification settings - Fork 302
Add YAML output (-y) and ISO 8601 date format option (-z) #370
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
Conversation
spenserblack
left a comment
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.
Overall, LGTM! ❤️ both YAML and ISO 😃
Left a suggestion on the CLI, let me know what you think 🙂
src/onefetch/cli.rs
Outdated
| .arg( | ||
| Arg::with_name("yaml") | ||
| .short("y") | ||
| .long("yaml") | ||
| .help("Outputs Onefetch in YAML format.") |
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.
Since this conflicts with the --json flag, I think that either
conflicts_with("json")should be added (and also aconflicts_with("yaml")for the jsonArg), or- The
--jsonand--yamlflags should be replaced with a--formatArgwith the possible valuesjsonandyaml
Personally, I think the latter would be better to keep the CLI as simple as possible 🙂
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.
I'm working on the latter, I'll be pushing a commit soon.
|
Thanks for your PR @kernel-sanders. Everything else LGTM 👍 |
kernel-sanders
left a comment
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.
Looks great! Moving the output logic into printers.rs cleans up main a bit as well.
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
This pull adds a -y flag which enables YAML output as well as a -z flag that outputs dates in ISO 8601 format. I'm using this to populate data on repos for a personal project so if these features don't interest you, no worries!