7.3.1 Error: No such option: --verbosity (Possible options: --verbose, --version)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Snapcraft help shows verbosity option
$ snapcraft -h
...
The option works but fails when legacy implementation is run. To reproduce, run the `snapcraft --verbosity trace` on snaps that are not core-22.
$ snapcraft --verbosity trace
2023-04-17 17:36:58.423 Starting Snapcraft 7.3.1
2023-04-17 17:36:58.423 Logging execution to '/home/
2023-04-17 17:36:58.423 Raw pre-parsed sysargs: args={'help': False, 'verbose': False, 'quiet': False, 'verbosity': 'trace', 'version': False, 'trace': False} filtered=[]
2023-04-17 17:36:58.423 Using default command: 'pack'
2023-04-17 17:36:58.423 General parsed sysargs: command='pack' args=[]
2023-04-17 17:36:58.424 Command parsed sysargs: Namespace(
2023-04-17 17:36:58.425 lifecycle command: 'pack', arguments: Namespace(
2023-04-17 17:36:58.425 command: pack, arguments: Namespace(
2023-04-17 17:36:58.430 run legacy implementation: base is not core22
Usage: snapcraft [OPTIONS] COMMAND [ARGS]...
Try 'snapcraft -h' for help.
Error: No such option: --verbosity (Possible options: --verbose, --version)
This is the line that produces the message https:/
It looks like the arguments are not explicitly passed to legacy CLI, and `click` in legacy uses the same global `sys.argv`, which contains newer options.
The solution could be to whitelist only supported options and transform `--verbosity trace|debug` into `enable_
https:/
Hi Anatoli!
Thanks for reporting this bug. I can confirm that the `--verbosity` argument is not supported for building core18|20 snaps. I appreciate the suggestions too.