Skip to content

Remove no longer used functions. #11

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Remove no longer used functions. #11

wants to merge 2 commits into from

Conversation

woblerr
Copy link
Owner

@woblerr woblerr commented Jun 26, 2025

It is enough to use __pgbackrest_command_options_values function.

See pgbackrest/pgbackrest#2638

woblerr added 2 commits June 6, 2025 23:57
It is enough to use __pgbackrest_command_options_values function.
The documentation contains 2 lists, so it's easier to keep a separate function..
@woblerr woblerr requested a review from Copilot June 26, 2025 13:45
@woblerr woblerr self-assigned this Jun 26, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR streamlines option value completions by removing specialized helper functions and relying on the generic __pgbackrest_command_options_values for most commands.

  • Removed unused functions for --output (verify, version) and --type (info) option values.
  • Introduced __pgbackrest_command_options_values_output_repo_ls for repo-ls only.
  • Updated --output case branches in two parsing blocks to use the new generic and repo-ls functions.
Comments suppressed due to low confidence (3)

pgbackrest-completion.sh:161

  • By removing the specialized verify and version branches for --output, the completion values for those commands now fall back to the generic helper. Please confirm that __pgbackrest_command_options_values returns the correct output options for verify and version or reintroduce specialized case handling if needed.
                            case ${COMP_WORDS[1]} in

pgbackrest-completion.sh:162

  • [nitpick] The --output handling logic is duplicated in two locations. Consider extracting this case block into a helper function to reduce duplication and simplify future updates.
                                repo-ls)

pgbackrest-completion.sh:27

  • It’s safer to quote the variable in the echo (echo "${command_options_values}") to prevent word-splitting and preserve values containing spaces.
    echo ${command_options_values}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant