Adds experimental --ion-version option#128
Conversation
| non-goal. | ||
| help Print this message or the help of the given subcommand(s) | ||
| cat Prints all Ion input files to the specified output in the requested format. | ||
| count (UNSTABLE) Prints the number of top-level values found in the input stream. |
There was a problem hiding this comment.
What makes count unstable, anyway?
There was a problem hiding this comment.
I have no idea, but it was in the beta namespace, so I'm leaving it as unstable for now. We can fix that in a separate PR.
There was a problem hiding this comment.
Actually, it is possible that #104 could eventually replace count, so maybe that's a good reason to leave it a "unstable" for now.
| fn configure_args(&self, command: Command) -> Command { | ||
| command.with_input().with_output().with_format() | ||
| command | ||
| .alias("dump") |
| /// Indicates whether this command is stable (as opposed to unstable or experimental). | ||
| /// Namespaces should almost always be stable. | ||
| fn is_stable(&self) -> bool { | ||
| true | ||
| } | ||
|
|
||
| /// Whether the output format is machine-readable. | ||
| /// | ||
| /// Commands that are "plumbing" should default to putting one output (result, value, document) | ||
| /// on each line in a machine-readable format (file name, Ion value(s), integers, booleans) | ||
| /// without any prose or table formatting, etc. | ||
| /// | ||
| /// See https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain#_plumbing_porcelain | ||
| fn is_porcelain(&self) -> bool { | ||
| false | ||
| } |
There was a problem hiding this comment.
Should the defaults be flipped here? I'd rather default to assuming that commands are unstable and porcelain, and have commands intentionally vouch that they are stable or plumbing.
There was a problem hiding this comment.
I don't mind flipping them.
jobarr-amzn
left a comment
There was a problem hiding this comment.
I'm happy to approve it as-is, I'd like to change the default unstable/porcelain values but there's no need to couple that here.
Issue #, if available:
#85
Description of changes:
Changes are mostly broken up by commits
dumpcommand in favor of using clap'saliasfeature to achieve the same effect.--unstable/-Xto opt into experimental features.is_porcelain()function to theIonCliCommandtrait. If implemented to return true, it gets a warning at the bottom of the command help that the output is not intended to be suitable for machine-readable use cases.--ion-versionoptionBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.