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

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

Closed
3 tasks done
SnoopJ opened this issue Mar 4, 2021 · 3 comments
Closed
3 tasks done

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

SnoopJ opened this issue Mar 4, 2021 · 3 comments
Labels
area/cli Related to the command line kind/bug Something isn't working as expected

Comments

@SnoopJ
Copy link

SnoopJ commented Mar 4, 2021

  • 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.

@SnoopJ SnoopJ added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Mar 4, 2021
@SnoopJ
Copy link
Author

SnoopJ commented Mar 4, 2021

Related issues: #1141 #3675 #2266

@mkniewallner
Copy link
Member

This has been fixed on master, and will be part of 1.2 release:

$ poetry -v add coverage
Using virtualenv: <REDACTED>
Using version ^6.4.1 for coverage

Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file
[...]

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 16, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli Related to the command line kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants