[pacman-dev] [PATCH 4/4] CLI args: update --help and manpage

Xavier Chantry chantry.xavier at gmail.com
Tue Oct 12 04:34:36 EDT 2010


On Tue, Oct 12, 2010 at 4:04 AM, Dan McGee <dpmcgee at gmail.com> wrote:
>
> I'm not too thrilled abuot this patch for the fact that we lost alpha
> ordering by shortopt for sync/upgrade/remove options. This is a step
> backwards in my opinion.
>
> I can deal with the dbpath/root/every single op uses these things
> being at the bottom (and I think a blank line separating them would be
> good too), but the list seems very mismanaged for the main ops now.
>
> I pulled the other two patches in, but not this one.
>

usage:  pacman {-S --sync} [options] [package(s)]
options:
      --asdeps         install packages as non-explicitly installed
      --asexplicit     install packages as explicitly installed
  -c, --clean          remove old packages from cache directory (-cc for all)
  -d, --nodeps         skip dependency checks
  -f, --force          force install, overwrite conflicting files
  -g, --groups         view all members of a package group
  -i, --info           view package information
  -l, --list <repo>    view a list of packages in a repo
  -s, --search <regex> search remote repositories for matching strings
  -u, --sysupgrade     upgrade installed packages (-uu allows downgrade)
  -w, --downloadonly   download packages but do not install/upgrade anything
  -y, --refresh        download fresh package databases from the server
      --needed         don't reinstall up to date packages
      --ignore <pkg>   ignore a package upgrade (can be used more than once)
      --ignoregroup <grp>
                       ignore a group upgrade (can be used more than once)
      --print          only print the targets instead of performing
the operation
      --print-format <string>
                       specify how the targets should be printed
  -q, --quiet          show less information for query and search
      --config <path>  set an alternate configuration file
      --logfile <path> set an alternate log file
      --noconfirm      do not ask for any confirmation
      --noprogressbar  do not show a progress bar when downloading files
      --noscriptlet    do not execute the install scriptlet if one exists
  -v, --verbose        be verbose
      --debug          display debug messages
  -r, --root <path>    set an alternate installation root
  -b, --dbpath <path>  set an alternate database location
      --cachedir <dir> set an alternate package cache location
      --arch <arch>    set an alternate architecture

I don't understand why it is fine to have -q -v -r -b mixed up like
that for the global section, but not have two other similar sections,
which makes it much nicer to check consistency of code, --help and
manpage. Isn't it nice to have that ?
Maybe you can only appreciate that patch if you try checking the
consistency before.

Otherwise we can just do pacman -Sh | sort :
      --arch <arch>    set an alternate architecture
      --asdeps         install packages as non-explicitly installed
      --asexplicit     install packages as explicitly installed
  -b, --dbpath <path>  set an alternate database location
      --cachedir <dir> set an alternate package cache location
  -c, --clean          remove old packages from cache directory (-cc for all)
      --config <path>  set an alternate configuration file
      --debug          display debug messages
  -d, --nodeps         skip dependency checks
  -f, --force          force install, overwrite conflicting files
  -g, --groups         view all members of a package group
                       ignore a group upgrade (can be used more than once)
      --ignoregroup <grp>
      --ignore <pkg>   ignore a package upgrade (can be used more than once)
  -i, --info           view package information
  -k, --dbonly         only modify database entries, not package files
  -l, --list <repo>    view a list of packages in a repo
      --logfile <path> set an alternate log file
      --needed         don't reinstall up to date packages
      --noconfirm      do not ask for any confirmation
      --noprogressbar  do not show a progress bar when downloading files
      --noscriptlet    do not execute the install scriptlet if one exists
      --print-format <string>
      --print          only print the targets instead of performing
the operation
  -q, --quiet          show less information for query and search
  -r, --root <path>    set an alternate installation root
                       specify how the targets should be printed
  -s, --search <regex> search remote repositories for matching strings
  -u, --sysupgrade     upgrade installed packages (-uu allows downgrade)
  -v, --verbose        be verbose
  -w, --downloadonly   download packages but do not install/upgrade anything
  -y, --refresh        download fresh package databases from the server

I suppose I could do that in code, just replace all printf by addlist,
sort the list at the end and print it.
That way the options will always appear in the same order, no matter
how they are written in the code.


More information about the pacman-dev mailing list