forked from TrueCloudLab/frostfs-node
[#1592] cmd: Ignore error when fetching a defined flag
There is an error only if the flag is not defined, such errors should be caught during debugging. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
f7d5045876
commit
b8508585a5
2 changed files with 4 additions and 4 deletions
|
@ -50,8 +50,8 @@ func Execute() error {
|
|||
}
|
||||
|
||||
func entryPoint(cmd *cobra.Command, args []string) error {
|
||||
printVersion, err := cmd.Flags().GetBool("version")
|
||||
if err == nil && printVersion {
|
||||
printVersion, _ := cmd.Flags().GetBool("version")
|
||||
if printVersion {
|
||||
cmd.Print(misc.BuildInfo("NeoFS Adm"))
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ var command = &cobra.Command{
|
|||
}
|
||||
|
||||
func entryPoint(cmd *cobra.Command, _ []string) error {
|
||||
printVersion, err := cmd.Flags().GetBool("version")
|
||||
if err == nil && printVersion {
|
||||
printVersion, _ := cmd.Flags().GetBool("version")
|
||||
if printVersion {
|
||||
cmd.Print(misc.BuildInfo("NeoFS Lens"))
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue