Fix merge conflicts

This commit is contained in:
Fredrik Wallgren 2015-11-22 00:58:27 +01:00
parent b0d37d1fb2
commit 670c7b787d
No known key found for this signature in database
GPG Key ID: F47F4EC105BDC53E
1 changed files with 7 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import (
"io"
"os"
"path/filepath"
"reflect"
"strings"
)
@ -76,6 +77,7 @@ func (p *Parser) WriteHelp(w io.Writer) {
}
}
// write the list of options
fmt.Fprint(w, "\noptions:\n")
for _, spec := range options {
printOption(w, spec)
@ -103,9 +105,11 @@ func printOption(w io.Writer, spec *spec) {
// Check if spec.dest is zero value or not
// If it isn't a default value have been added
v := spec.dest
z := reflect.Zero(v.Type())
if v.Interface() != z.Interface() {
fmt.Fprintf(w, " [default: %v]", v)
if v.IsValid() {
z := reflect.Zero(v.Type())
if v.Interface() != z.Interface() {
fmt.Fprintf(w, " [default: %v]", v)
}
}
fmt.Fprint(w, "\n")
}