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

Add config option to enable or disable AUR completions #539

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add config option to enable or disable AUR completions
Adds the new confg option "completeaur" with corresponding cmd flags.
Defaults to 'true' to maintain existing behavior when not set.
  • Loading branch information
ipha committed Jul 8, 2018
commit 91b7405445fa32749e578010733565dede6d5874
7 changes: 7 additions & 0 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ Permanent configuration options:
--timeupdate Check packages' AUR page for changes during sysupgrade
--notimeupdate Do not check packages' AUR page for changes

--completeaur Include AUR packages in completions
--nocompleteaur Do not include AUR packages in completions

Print specific options:
-c --complete Used for completions
-d --defaultconfig Print default yay configuration
Expand Down Expand Up @@ -353,6 +356,10 @@ func handleConfig(option, value string) bool {
config.CombinedUpgrade = true
case "nocombinedupgrade":
config.CombinedUpgrade = false
case "completeaur":
config.CompleteAUR = true
case "nocompleteaur":
config.CompleteAUR = false
case "a", "aur":
mode = ModeAUR
case "repo":
Expand Down
8 changes: 5 additions & 3 deletions completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ func complete(shell string) error {
}

// AUR
err = completePart(shell, path_aur, true)
if err != nil {
return err
if config.CompleteAUR {
err = completePart(shell, path_aur, true)
if err != nil {
return err
}
}

return nil
Expand Down
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type Configuration struct {
EditMenu bool `json:"editmenu"`
CombinedUpgrade bool `json:"combinedupgrade"`
UseAsk bool `json:"useask"`
CompleteAUR bool `json:"completeaur"`
}

var version = "7.885"
Expand Down Expand Up @@ -181,6 +182,7 @@ func defaultSettings(config *Configuration) {
config.EditMenu = false
config.UseAsk = false
config.CombinedUpgrade = false
config.CompleteAUR = true
}

// Editor returns the preferred system editor.
Expand Down