Remove global flags from filesystem command (#772)

* Remove global flags from subcommands

If the global flags are added to the subcommand as well as being used
globally, their value will be overwritten when the arguments for the
subcommand are parsed. This leads to the value passed to the flag at the
global position being lost.

* Update readme
This commit is contained in:
Robert Jacob
2021-01-05 11:49:39 +01:00
committed by GitHub
parent 5c5e0cb86d
commit e2c483f856
3 changed files with 45 additions and 54 deletions

View File

@@ -386,13 +386,10 @@ func NewFilesystemCommand() *cli.Command {
&exitCodeFlag,
&skipUpdateFlag,
&clearCacheFlag,
&quietFlag,
&ignoreUnfixedFlag,
&debugFlag,
&removedPkgsFlag,
&vulnTypeFlag,
&ignoreFileFlag,
&cacheDirFlag,
&cacheBackendFlag,
&timeoutFlag,
&noProgressFlag,
@@ -421,13 +418,10 @@ func NewRepositoryCommand() *cli.Command {
&exitCodeFlag,
&skipUpdateFlag,
&clearCacheFlag,
&quietFlag,
&ignoreUnfixedFlag,
&debugFlag,
&removedPkgsFlag,
&vulnTypeFlag,
&ignoreFileFlag,
&cacheDirFlag,
&cacheBackendFlag,
&timeoutFlag,
&noProgressFlag,
@@ -455,13 +449,10 @@ func NewClientCommand() *cli.Command {
&outputFlag,
&exitCodeFlag,
&clearCacheFlag,
&quietFlag,
&ignoreUnfixedFlag,
&debugFlag,
&removedPkgsFlag,
&vulnTypeFlag,
&ignoreFileFlag,
&cacheDirFlag,
&timeoutFlag,
&ignorePolicy,
@@ -494,9 +485,6 @@ func NewServerCommand() *cli.Command {
&skipUpdateFlag,
&downloadDBOnlyFlag,
&resetFlag,
&quietFlag,
&debugFlag,
&cacheDirFlag,
&cacheBackendFlag,
// original flags