Skip to content

Verbosity flag behavior does not reflect the usage given by --help #3751

@SnoopJ

Description

@SnoopJ
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Ubuntu 19.10

  • Poetry version: 1.1.4

  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

The -v flag behaves in a way that is not consistent with the usage given when running poetry --help, reproduced below:

USAGE
  poetry [-h] [-q] [-v [<...>]] [-V] [--ansi] [--no-ansi] [-n] <command> [<arg1>] ... [<argN>]

ARGUMENTS
  <command>              The command to execute
  <arg>                  The arguments of the command

GLOBAL OPTIONS
  -h (--help)            Display this help message
  -q (--quiet)           Do not output any message
  -v (--verbose)         Increase the verbosity of messages: "-v" for normal output, "-vv" for more
                         verbose output and "-vvv" for debug
  -V (--version)         Display this application version
  --ansi                 Force ANSI output
  --no-ansi              Disable ANSI output
  -n (--no-interaction)  Do not ask any interactive question

In particular, including the verbosity flag before a command will always trigger printing of the help.

19:09 [jgerity@tim /tmp/poetryproject]
$ poetry -v add coverage
USAGE
  poetry help [<command1>] ... [<commandN>]

ARGUMENTS
  <command>              The command name

GLOBAL OPTIONS
  -h (--help)            Display this help message
  -q (--quiet)           Do not output any message
  -v (--verbose)         Increase the verbosity of messages: "-v" for normal output, "-vv" for more
                         verbose output and "-vvv" for debug
  -V (--version)         Display this application version
  --ansi                 Force ANSI output
  --no-ansi              Disable ANSI output
  -n (--no-interaction)  Do not ask any interactive question

Additionally, passing a single -v after a command seems to swallow the first command argument (which will often be the only one).

19:09 [jgerity@tim /tmp/poetryproject]
$ poetry add -v coverage
Not enough arguments (missing: "name").

I believe these may be upstream bugs in cleo or clikit, but can't tell which of those is responsible. Since it's affecting the usability of this tool, I figured it was appropriate to open a bug here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliRelated to the command linekind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions