Skip to content

Commit

Permalink
fix(yay): show yay usage always on --help -h (#2051)
Browse files Browse the repository at this point in the history
fix yay usage not showing
  • Loading branch information
Jguer authored Apr 3, 2023
1 parent 956c4cb commit 9532e7b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ operations:
yay {-U --upgrade} [options] <file(s)>
New operations:
yay {-Y --yay} [options] [package(s)]
yay {-P --show} [options]
yay {-B --build} [options] [dir]
yay {-G --getpkgbuild} [options] [package(s)]
yay {-P --show} [options]
yay {-W --web} [options] [package(s)]
yay {-Y --yay} [options] [package(s)]
If no arguments are provided 'yay -Syu' will be performed
If no operation is provided -Y will be assumed
If no operation is specified 'yay -Syu' will be performed
If no operation and no targets are provided -Y will be assumed
New options:
--repo Assume targets are from the repositories
Expand Down Expand Up @@ -121,10 +123,6 @@ Permanent configuration options:
--nopgpfetch Don't prompt to import PGP keys
--useask Automatically resolve conflicts using pacman's ask flag
--nouseask Confirm conflicts manually during the install
--combinedupgrade Refresh then perform the repo and AUR upgrade together
--nocombinedupgrade Perform the repo upgrade and AUR upgrade separately
--batchinstall Build multiple AUR packages then install them together
--nobatchinstall Build and install each AUR package one by one
--sudo <file> sudo command to use
--sudoflags <flags> Pass arguments to sudo
Expand Down Expand Up @@ -248,12 +246,13 @@ func handleQuery(ctx context.Context, cfg *settings.Configuration, cmdArgs *pars
}

func handleHelp(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments) error {
usage()
switch cmdArgs.Op {
case "Y", "yay", "G", "getpkgbuild", "P", "show", "W", "web", "B", "build":
usage()
return nil
}

cfg.Runtime.Logger.Println("\npacman operation specific options:")
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, cfg.Mode, settings.NoConfirm))
}
Expand Down

0 comments on commit 9532e7b

Please sign in to comment.