pflag icon indicating copy to clipboard operation
pflag copied to clipboard

Document behavior of backticks in usage string

Open AlexNPavel opened this issue 7 years ago • 3 comments

Pflag changes the type of a flag to match a string in back quotes in the usage string. For example, if flag "test" had usage message "this sets up the testtype variable", the output would be:

      --test testtype  this sets up the testtype variable

This is unexpected behavior and is also not documented anywhere except in this godoc for the UnquoteUsage function: https://godoc.org/github.com/spf13/pflag#UnquoteUsage

This should be documented somewhere more visibly as back quotes are commonly used in descriptions and usage text.

AlexNPavel avatar Jan 25 '19 22:01 AlexNPavel