-
Notifications
You must be signed in to change notification settings - Fork 664
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
[GCU] Show default option for '--format' #2003
Conversation
@@ -1188,7 +1188,8 @@ def print_dry_run_message(dry_run): | |||
@click.argument('patch-file-path', type=str, required=True) | |||
@click.option('-f', '--format', type=click.Choice([e.name for e in ConfigFormat]), | |||
default=ConfigFormat.CONFIGDB.name, | |||
help='format of config of the patch is either ConfigDb(ABNF) or SonicYang') | |||
help='format of config of the patch is either ConfigDb(ABNF) or SonicYang', |
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.
Regarding the format string, we prefer ConfigYang or config_yang (ref: https://github.com/Azure/sonic-utilities/blob/055ed4fafeaece1f00e4dcb20631805a5e621fb6/config/main.py#L1335).
The reason is to align with the naming of config_db. And in future we may have state_db/state_yang (just a conceptual example).
If you agree and would like to use another PR, we can merge this PR first.
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.
let me address this in a different PR
#### What I did Show the default enum for the option `--format` #### How I did it Added `show_default=True` #### How to verify it Checkout output below #### Previous command output (if the output of a command-line utility has changed) ```bash admin@vlab-01:~$ sudo config apply-patch -h Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH Apply given patch of updates to Config. A patch is a JsonPatch which follows rfc6902. This command can be used do partial updates to the config with minimum disruption to running processes. It allows addition as well as deletion of configs. The patch file represents a diff of ConfigDb(ABNF) format or SonicYang format. <patch-file-path>: Path to the patch file on the file-system. Options: -f, --format [CONFIGDB|SONICYANG] format of config of the patch is either ConfigDb(ABNF) or SonicYang -d, --dry-run test out the command without affecting config state -v, --verbose print additional details of what the operation is doing -h, -?, --help Show this message and exit. admin@vlab-01:~$ ``` #### New command output (if the output of a command-line utility has changed) ```sh admin@vlab-01:~$ sudo config apply-patch -h Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH Apply given patch of updates to Config. A patch is a JsonPatch which follows rfc6902. This command can be used do partial updates to the config with minimum disruption to running processes. It allows addition as well as deletion of configs. The patch file represents a diff of ConfigDb(ABNF) format or SonicYang format. <patch-file-path>: Path to the patch file on the file-system. Options: -f, --format [CONFIGDB|SONICYANG] format of config of the patch is either ConfigDb(ABNF) or SonicYang [default: CONFIGDB] -d, --dry-run test out the command without affecting config state -v, --verbose print additional details of what the operation is doing -h, -?, --help Show this message and exit. admin@vlab-01:~$ ```
What I did
Show the default enum for the option
--format
How I did it
Added
show_default=True
How to verify it
Checkout output below
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)