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

Update manual page and remove deprecate/removed options #1951

Merged
merged 2 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 1 addition & 11 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
36 changes: 19 additions & 17 deletions doc/yay.8
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand All @@ -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.

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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>
18 changes: 0 additions & 18 deletions print.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down