Skip to content

zsh: don't complete conflicting options#10435

Merged
MikeMcQuaid merged 2 commits intoHomebrew:masterfrom
jonchang:conflict-zsh-completions
Jan 28, 2021
Merged

zsh: don't complete conflicting options#10435
MikeMcQuaid merged 2 commits intoHomebrew:masterfrom
jonchang:conflict-zsh-completions

Conversation

@jonchang
Copy link
Copy Markdown
Contributor

@jonchang jonchang commented Jan 27, 2021

Before:

% brew --cache --cask --<TAB>
--build-from-source  -- Show the cache file used when building from source
--debug              -- Display any debugging information
--force-bottle       -- Show the cache file used when pouring a bottle
--formula            -- Only show cache files for formulae
--help               -- Show this message
--quiet              -- Make some output more quiet
--verbose            -- Make some output more verbose

After:

% brew --cache --cask --<TAB>
--debug    -- Display any debugging information
--help     -- Show this message
--quiet    -- Make some output more quiet
--verbose  -- Make some output more verbose
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?
  • Have you successfully run brew man locally and committed any changes?

@jonchang jonchang requested a review from Rylan12 January 27, 2021 03:33
@BrewTestBot
Copy link
Copy Markdown
Contributor

Review period will end on 2021-01-28 at 03:33:14 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Jan 27, 2021

def generate_zsh_option_exclusions(command, option)
conflicts = Commands.option_conflicts(command, option.gsub(/^--/, ""))
return "" unless conflicts.presence
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return "" unless conflicts.presence
return "" if conflicts.blank?

Copy link
Copy Markdown
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

This is great, thanks, @jonchang!

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Jan 28, 2021
@BrewTestBot
Copy link
Copy Markdown
Contributor

Review period ended.

@MikeMcQuaid MikeMcQuaid merged commit 0fc2e82 into Homebrew:master Jan 28, 2021
@MikeMcQuaid
Copy link
Copy Markdown
Member

Thanks @jonchang!

@jonchang jonchang deleted the conflict-zsh-completions branch February 4, 2021 04:15
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Mar 7, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Mar 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated PR was locked due to age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants