pipx icon indicating copy to clipboard operation
pipx copied to clipboard

description of option --global is missleading

Open return42 opened this issue 1 year ago • 1 comments

Describe the bug

The help message describes the options in the comandline in front:

$ pipx --help
usage: pipx [-h] [--quiet] [--verbose] [--global] [--version]
            {install, ..list, ..}
$ pipx --version
1.6.0

But when using the option --global in front of the command, the option is ignored:

$ sudo pipx --global list
nothing has been installed with pipx 😴

How to reproduce

We have to set the option behind the command:

$ sudo pipx list --global
venvs are in /opt/pipx/venvs
apps are exposed on your $PATH at /usr/local/bin
manual pages are exposed at /usr/local/share/man
   package ocrmypdf 16.5.0, installed using Python 3.12.5
    - ocrmypdf

This is the same with all the other commands who have a --global option (install, unistall ..).

Expected behavior

A bugfix for the commandline parser or at least the documentation is needed.

return42 avatar Sep 06 '24 12:09 return42

Actually, I would very much appreciate if --global were to be supported as outlined in the help right now.

There are environments where I always want to invoke pipx with --global flag. One way of achieving that would be a simple alias pipx='pipx --global'. Requiring the --global after the command makes this much less clean.

Also, just plain ignoring it in the wrong place instead of raising an error about an unknown flag is very error-prone.

creckord avatar Nov 10 '25 10:11 creckord