Skip to content
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

(MAINT) Fix the registry find command options #163

Merged

Conversation

michaeltlombardi
Copy link
Collaborator

PR Summary

This change removes the short form for the --keys_only and --values_only options, removing the conflict so the command doesn't panic.

The new options from registry find --help display as:

Find a registry key or value.

Usage: registry.exe find [OPTIONS] --key-path <KEY_PATH> --find <FIND>

Options:
  -k, --key-path <KEY_PATH>  The registry key path to start find.
  -f, --find <FIND>          The string to find.
  -r, --recurse              Recursively find.
      --keys-only            Only find keys.
      --values-only          Only find values.
  -h, --help                 Print help

PR Context

Prior to this change, the registry find command panicked because the key_path and keys_only options both declared the default short form for the options. Clap resolved both options to short form -k, leading to a conflict and panic.

Prior to this change, the `registry find` command panicked because the `key_path` and
`keys_only` options both declared the default short form for the options. Clap resolved
both options to short form `-k`, leading to a conflict and panic.

This change removes the short form for the `--keys_only` and `--values_only` options,
removing the conflict so the command doesn't panic.

The new options from `registry find --help` display as:

```console
Find a registry key or value.

Usage: registry.exe find [OPTIONS] --key-path <KEY_PATH> --find <FIND>

Options:
  -k, --key-path <KEY_PATH>  The registry key path to start find.
  -f, --find <FIND>          The string to find.
  -r, --recurse              Recursively find.
      --keys-only            Only find keys.
      --values-only          Only find values.
  -h, --help                 Print help
```
@SteveL-MSFT SteveL-MSFT merged commit 48770b3 into PowerShell:main Aug 22, 2023
4 checks passed
@michaeltlombardi michaeltlombardi deleted the maint/main/fix-registry-find branch August 22, 2023 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants