mkideal / cli

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

Parameter, option & argument #24

Closed suntong closed 8 years ago

suntong commented 8 years ago

May be it is a good idea to standardize the usage of "parameter", "option" & "argument" throughout cli according to GNU getopt.

From man getopt:

The parameters are parsed from left to right. Each parameter is classified as a short option, a long option, an argument to an option, or a non-option parameter.

I.e., the parameter and option are (almost) interchangeable, while argument normally means the actual value for the option.

I don't know how cohesive such names are used throughout cli, but I did notice one that's not quite right -- the output of 003-required-flag.go

$ go run 003-required-flag.go 
ERR! required argument --id missing

It is better be called "required parameter" instead of argument here. and it might be a good idea to check the whole cli messages to check for such cohesive usage (to make 风格更为统一).

suntong commented 8 years ago

Here is another one:

$ go run 001-hello.go -name ERR! undefined flag -n

I know that flag in go means the same thing as parameter and option, but it is better to be cohesive throughout all messages.

mkideal commented 8 years ago

Thanks for your suggestion. I have fix these error messages.

suntong commented 8 years ago

:+1: