codegangsta/cli — pull request #58 by tjarratt (2013-12-31 19:33:36+00:00)
Title: Allow flags to omit their default value in String()

This feature allows users to have a very clean and simple output for flags in --help output. I encountered this in a CLI tool I'm working on, where several string flags have no default value (ie: their actual default value is an empty string), and the resulting output for --help is a little ugly.

In order to accomplish this, I added a bool to some Flag structs, namely `OmitDefaultValue`. As a result of this, the default constructor for StringFlag, IntFlag, and Float64Flag. From what I can tell, few people in the Go community tend to use the default struct constructors without named parameters, but I wanted to point out that this is a breaking change.

With that said, I'm open to any suggestions to improve this PR. I had considered creating my own flags in my app with a custom `String()` func, but that seemed difficult for us to maintain, and I had hoped that other people might find this useful as well.

Example of the existing behavior:
```shell
>my-cool-app something --help
NAME:
something - Does something really important, probably

USAGE:
my-cool-app something [-b Blubber] [-c CLIs] [-d Detroit] [-e Everything]
[-f Frumpy] [-g Grapes] [-h Hankering] [-i Indigo] [-j Jallopies]

OPTIONS:
-b ''	Blubber and Bales
-c ''	Cranky CLIs
-d ''	Destruction of Detroit
-e ''	Everything And More
-f ''	Frumpy Flags are Fruitful
-g ''	Great Grapes
-h ''	Headache Hankering
-i ''	Indigo Iodine
-j ''	Jumping Jallopies
```

Desired behavior:
```shell
>my-cool-app something --help
NAME:
something - Does something really important, probably

USAGE:
my-cool-app something [-b Blubber] [-c CLIs] [-d Detroit] [-e Everything]
[-f Frumpy] [-g Grapes] [-h Hankering] [-i Indigo] [-j Jallopies]

OPTIONS:
-b	Blubber and Bales
-c	Cranky CLIs
-d	Destruction of Detroit
-e	Everything And More
-f	Frumpy Flags are Fruitful
-g	Great Grapes
-h	Headache Hankering
-i	Indigo Iodine
-j	Jumping Jallopies
```