mkideal / cli

CLI - A package for building command line app with go
MIT License
732 stars 43 forks source link

optional arguments #31

Open suntong opened 7 years ago

suntong commented 7 years ago

The GNU getopt supports optional arguments:

A long option normally begins with '--' followed by the long option name. If the option has a required argument, it may be written directly after the long option name, separated by '=', or as the next argument (i.e. separated by whitespace on the command line). If the option has an optional argument, it must be written directly after the long option name, separated by '=', if present.

Would cli support optional arguments as well? If true, please make it clear of the following three stages:

  1. not specified
  2. specified but no argument
  3. specified and with argument

Thanks

mkideal commented 7 years ago

optional arguments supported but 0/1/2 stages not reported. I will add API later.