Skip to content

Commit

Permalink
define map globally
Browse files Browse the repository at this point in the history
  • Loading branch information
danielb42 authored and alecthomas committed Feb 5, 2018
1 parent 304264a commit 2a5eb22
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions model.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ import (

// Data model for Kingpin command-line structure.

var (
ignoreInCount = map[string]bool{
"help": true,
"help-long": true,
"help-man": true,
"completion-bash": true,
"completion-script-bash": true,
"completion-script-zsh": true,
}
)

type FlagGroupModel struct {
Flags []*FlagModel
}
Expand All @@ -18,15 +29,6 @@ func (f *FlagGroupModel) FlagSummary() string {

for _, flag := range f.Flags {

ignoreInCount := map[string]bool{
"help": true,
"help-long": true,
"help-man": true,
"completion-bash": true,
"completion-script-bash": true,
"completion-script-zsh": true,
}

if !ignoreInCount[flag.Name] {
count++
}
Expand Down

0 comments on commit 2a5eb22

Please sign in to comment.