Update manual page and remove deprecate/removed options (#1951)

* add new options and remove deprecated

* add new -Bi
This commit is contained in:
Jo 2023-03-08 13:07:15 +00:00 committed by GitHub
parent 7073939cdc
commit c744058b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 46 deletions

12
cmd.go
View File

@ -269,24 +269,14 @@ func handlePrint(ctx context.Context, cfg *settings.Configuration, cmdArgs *pars
fmt.Printf("%v", cfg)
return nil
case cmdArgs.ExistsArg("n", "numberupgrades"):
filter, err := getFilter(cmdArgs)
if err != nil {
return err
}
return printNumberOfUpdates(ctx, cfg, dbExecutor, cmdArgs.ExistsDouble("u", "sysupgrade"), filter)
case cmdArgs.ExistsArg("w", "news"):
double := cmdArgs.ExistsDouble("w", "news")
quiet := cmdArgs.ExistsArg("q", "quiet")
return news.PrintNewsFeed(ctx, cfg.Runtime.HTTPClient, dbExecutor.LastBuildTime(), cfg.BottomUp, double, quiet)
case cmdArgs.ExistsDouble("c", "complete"):
return completion.Show(ctx, cfg.Runtime.HTTPClient, dbExecutor,
cfg.AURURL, cfg.Runtime.CompletionPath, cfg.CompletionInterval, true)
case cmdArgs.ExistsArg("c", "complete"):
return completion.Show(ctx, cfg.Runtime.HTTPClient, dbExecutor,
cfg.AURURL, cfg.Runtime.CompletionPath, cfg.CompletionInterval, false)
cfg.AURURL, cfg.Runtime.CompletionPath, cfg.CompletionInterval, cmdArgs.ExistsDouble("c", "complete"))
case cmdArgs.ExistsArg("s", "stats"):
return localStatistics(ctx, cfg, dbExecutor)
}

View File

@ -1,4 +1,4 @@
.TH "YAY" "8" "2019\-10\-21" "Yay v9.4+" "Yay Manual"
.TH "YAY" "8" "2019\-10\-21" "Yay v12.0+" "Yay Manual"
.nh
.ad l
.SH NAME
@ -19,11 +19,16 @@ This manpage only covers options unique to Yay. For other options see
\fBpacman(8)\fR.
.SH YAY OPERATIONS
.TP
.B \-Y, \-\-yay
Perform yay specific operations. This is the default if no other operation is
selected.
.TP
.B \-B, \-\-build
Build a PKGBUILD in a given directory.
.TP
.B \-P, \-\-show
Perform yay specific print operations.
@ -32,6 +37,10 @@ Perform yay specific print operations.
.B \-G, \-\-getpkgbuild
Downloads PKGBUILD from ABS or AUR. The ABS can only be used for Arch Linux repositories.
.TP
.B \-W, \-\-web
Web related operations such as voting for AUR packages.
.RE
If no arguments are provided 'yay \-Syu' will be performed.
@ -84,16 +93,12 @@ used when migrating to Yay from another AUR helper.
.B \-c, \-\-clean
Remove unneeded dependencies.
.SH SHOW OPTIONS (APPLY TO \-P AND \-\-SHOW)
.SH SHOW OPTIONS (APPLY TO \-P AND \-\-show)
.TP
.B \-c, \-\-complete
Print a list of all AUR and repo packages. This allows shell completion
and is not intended to be used directly by the user.
.TP
.B \-f, \-\-fish
During complete adjust the output for the fish shell.
.TP
.B \-d, \-\-defaultconfig
Print default yay configuration.
@ -102,20 +107,12 @@ Print default yay configuration.
.B \-g, \-\-currentconfig
Print current yay configuration.
.TP
.B \-n, \-\-numberupgrades
Deprecated, use \fByay -Qu\fR and \fBwc -l\fR instead\%.
.TP
.B \-s, \-\-stats
Displays information about installed packages and system health. If there are
orphaned, or out\-of\-date packages, or packages that no longer exist on the
AUR; warnings will be displayed.
.TP
.B \-u, \-\-upgrades
Deprecated, use \fByay -Qu\fR instead\%.
.TP
.B \-w, \-\-news
Print new news from the Archlinux homepage. News is considered new if it is
@ -126,7 +123,12 @@ available news.
.B \-q, \-\-quiet
Only show titles when printing news.
.SH GETPKGBUILD OPTIONS (APPLY TO \-G AND \-\-GETPKGBUILD)
.SH BUILD OPTIONS (APPLY TO \-B AND \-\-build)
.TP
.B \-i, \-\-install
Build and install a PKGBUILD in a given directory
.SH GETPKGBUILD OPTIONS (APPLY TO \-G AND \-\-getpkgbuild)
.TP
.B \-f, \-\-force
Force download for ABS packages that already exist in the current directory. This
@ -136,7 +138,7 @@ ensures directories are not accidentally overwritten.
.B \-p, \-\-print
Prints the PKGBUILD of the given packages to stdout.
.SH WEB OPTIONS (APPLY TO \-W AND \-\-WEB)
.SH WEB OPTIONS (APPLY TO \-W AND \-\-web)
.TP
Web related operations such as voting for AUR packages.
@ -644,6 +646,6 @@ See the arch wiki at https://wiki.archlinux.org/index.php/Arch_User_Repository f
Please report bugs to our GitHub page https://github.com/Jguer/yay
.SH AUTHORS
Jguer <joaogg3@gmail.com>
Jguer <joguer@proton.me>
.br
Morgan <morganamilo@archlinux.org>

View File

@ -97,24 +97,6 @@ func localStatistics(ctx context.Context, cfg *settings.Configuration, dbExecuto
return nil
}
func printNumberOfUpdates(ctx context.Context, cfg *settings.Configuration,
dbExecutor db.Executor, enableDowngrade bool, filter upgrade.Filter,
) error {
warnings := query.NewWarnings()
old := os.Stdout // keep backup of the real stdout
os.Stdout = nil
aurUp, repoUp, err := upList(ctx, cfg, warnings, dbExecutor, enableDowngrade, filter)
os.Stdout = old // restoring the real stdout
if err != nil {
return err
}
fmt.Println(len(aurUp.Up) + len(repoUp.Up))
return nil
}
func printUpdateList(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments,
dbExecutor db.Executor, enableDowngrade bool, filter upgrade.Filter,
) error {