wunderio / radi-cli

CLI interface for the Radi-API
1 stars 2 forks source link

radi version outputting does not work #22

Closed james-nesbitt closed 7 years ago

james-nesbitt commented 7 years ago

When trying to output the radi cli version, an error is produced:

-> % radi -v     
flag provided but not defined: -v
Usage of radi:
  -debug
        Enable verbose debugging output
  -environment string
        Activate a specific environment (default "local")

but the general radi help says that it is a valid flag:

GLOBAL OPTIONS:
   --environment value  Activate a specific environment
   --debug              Enable verbose debugging output (default: false) [$RADI_DEBUG]
   --help, -h           show help (default: false)
   --version, -v        print the version (default: false)
james-nesbitt commented 7 years ago

we have the same issue with the --help flag.

james-nesbitt commented 7 years ago

These issues occur because we have a hack in place to allow us to preprocess flags before passing them to our cli library (github.com/urfave/cli.)

The simple fix is to just add these flags to our hack, but ignore them.

james-nesbitt commented 7 years ago
-> % radi --version
wundertools version 0.3.0-dev (HEAD)
-> % radi --help
NAME:
   wundertools - Command line interface for Radi API.

USAGE:
   radi [global options] command [command options] [arguments...]

VERSION:
   0.3.0-dev (HEAD)

AUTHOR:
   Wunder.IO <https://github.com/wunderkraut/radi-cli>

COMMANDS:
     help, h  Shows a list of commands or help for one command
   local:
     local.project.init, project.init          Initialize the current project path as a radi project
     local.project.create, project.create      Create a new local project from a yml templating source.
     local.project.generate, project.generate  Create a yml template from the current project

GLOBAL OPTIONS:
   --environment value  Activate a specific environment
   --debug              Enable verbose debugging output (default: false) [$RADI_DEBUG]
   --help, -h           show help (default: false)
   --version, -v        print the version (default: false)
james-nesbitt commented 7 years ago

this was fixed with #28