Thanks for the review.
-Sg
act like you'd expect-Sgq
to act
Hmm, I’m afraid there may be a misunderstanding? Currently -Sg
(without targets) prints available group names only. I.e. it doesn't print group members.
-Sgg
is then used to do what you'd expect-Sg
to act-Sg foo
though, then acts how you'd expect and there's no concept of-Sgg foo
I agree.
I agree that the behavior of -Sg
/-Sgg
(without targets) are very weird, but rather than dropping -Sgg
, I was thinking that -Sg
and -Sgg
should be interchanged. So then things will be straightforward:
-Sg
(with or without targets): to view group members-Sgg
: to view group namesThis MR, however, is just intended to add [installed] to -Sg
(+ minor related fixes), not intended to be a breaking change, so I didn't do that this time (because I hope this MR will be merged as soon as possible).
While ${parameter%[word]}
removes smallest suffix pattern, ${parameter%%[word]}
removes largest suffix pattern.1 Since -Qg
now prints package versions as well, we need this to extract only the group name. Here's a small example of %
and %%
:
$ var='grp_name pkg_name pkg_ver'
$ echo "${var% *}"
grp_name pkg_name
$ echo "${var%% *}"
grp_name
For example, with this commit pacman -Rh
will print:
usage: pacman {-R --remove} [options] <package(s)>
main options:
-c, --cascade remove packages and all packages that depend on them
-n, --nosave remove configuration files
-s, --recursive remove unnecessary dependencies
(-ss includes explicitly installed dependencies)
-u, --unneeded remove unneeded packages
transaction options:
-d, --nodeps skip dependency version checks (-dd to skip all checks)
--assume-installed <package=version>
add a virtual package to satisfy dependencies
--dbonly only modify database entries, not package files
--noprogressbar do not show a progress bar when downloading files
--noscriptlet do not execute the install scriptlet if one exists
-p, --print print the targets instead of performing the operation
--print-format <string>
specify how the targets should be printed
general options:
-b, --dbpath <path> set an alternate database location
-r, --root <path> set an alternate installation root
-v, --verbose be verbose
--arch <arch> set an alternate architecture
--cachedir <dir> set an alternate package cache location
--color <when> colorize the output
--config <path> set an alternate configuration file
--debug display debug messages
--gpgdir <path> set an alternate home directory for GnuPG
--hookdir <dir> set an alternate hook location
--logfile <path> set an alternate log file
--noconfirm do not ask for any confirmation
--confirm always ask for confirmation
--disable-download-timeout
use relaxed timeouts for download
--sysroot operate on a mounted guest system (root-only)
instead of mixing options.
I think this way is much more user-friendly, especially for beginners and casual users (including myself) :)
FYI, some other package managers such as dnf
and pip
already do something similar.
This makes it easier to find operation-specific options and distinguish between common and advanced options.
Signed-off-by: Taro Tanaka mkrmdk@gmail.com
Taro Tanaka (2b751713) at 17 Jan 11:53
usage: Divide options into different sections based on the man page
Taro Tanaka (9f3235b2) at 10 Jan 12:24
Allow -q to argumentless -Qg/-Sgg as well
... and 1 more commit
Taro Tanaka (28b43ba8) at 08 Jan 17:33
Allow -q to argumentless -Qg/-Sgg as well
... and 1 more commit
This allows users to easily check which packages in a group are installed (or not).
This merge request also has related commits which make
the colored [installed]
labels less obtrusive.
Taro Tanaka (a1d74197) at 06 Jan 12:08
Add version information to -Qg/-Sg/-Sgg output
... and 1 more commit