forked from urfave/cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request urfave#1800 from urfave/v2-maint-goimports
Helper messages for documenting build process
- Loading branch information
Showing
4 changed files
with
38 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
.*envrc | ||
.envrc | ||
.idea | ||
# goimports is installed here if not available | ||
/.local/ | ||
/site/ | ||
coverage.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,71 @@ | ||
// WARNING: this file is generated. DO NOT EDIT | ||
{{.HeaderWarning}} | ||
|
||
package {{.PackageName}} | ||
|
||
{{range .SortedFlagTypes}} | ||
{{range .SortedFlagTypes -}} | ||
// {{.TypeName}} is a flag with type {{if .ValuePointer}}*{{end}}{{.GoType}} | ||
type {{.TypeName}} struct { | ||
Name string | ||
Name string | ||
|
||
Category string | ||
DefaultText string | ||
FilePath string | ||
Usage string | ||
Category string | ||
DefaultText string | ||
FilePath string | ||
Usage string | ||
|
||
Required bool | ||
Hidden bool | ||
HasBeenSet bool | ||
Required bool | ||
Hidden bool | ||
HasBeenSet bool | ||
|
||
Value {{if .ValuePointer}}*{{end}}{{.GoType}} | ||
Destination {{if .NoDestinationPointer}}{{else}}*{{end}}{{.GoType}} | ||
Value {{if .ValuePointer}}*{{end}}{{.GoType}} | ||
Destination {{if .NoDestinationPointer}}{{else}}*{{end}}{{.GoType}} | ||
|
||
Aliases []string | ||
EnvVars []string | ||
Aliases []string | ||
EnvVars []string | ||
|
||
defaultValue {{if .ValuePointer}}*{{end}}{{.GoType}} | ||
|
||
{{range .StructFields}} | ||
{{.Name}} {{if .Pointer}}*{{end}}{{.Type}} | ||
{{end}} | ||
defaultValue {{if .ValuePointer}}*{{end}}{{.GoType}} | ||
{{ range .StructFields}} | ||
{{.Name}} {{if .Pointer}}*{{end}}{{.Type}} | ||
{{end -}} | ||
} | ||
|
||
{{if .GenerateFmtStringerInterface}} | ||
{{if .GenerateFmtStringerInterface -}} | ||
// String returns a readable representation of this value (for usage defaults) | ||
func (f *{{.TypeName}}) String() string { | ||
return {{$.UrfaveCLINamespace}}FlagStringer(f) | ||
return {{$.UrfaveCLINamespace}}FlagStringer(f) | ||
} | ||
|
||
{{end}}{{/* /if .GenerateFmtStringerInterface */}} | ||
|
||
{{if .GenerateFlagInterface}} | ||
{{- if .GenerateFlagInterface -}} | ||
// IsSet returns whether or not the flag has been set through env or file | ||
func (f *{{.TypeName}}) IsSet() bool { | ||
return f.HasBeenSet | ||
return f.HasBeenSet | ||
} | ||
|
||
// Names returns the names of the flag | ||
func (f *{{.TypeName}}) Names() []string { | ||
return {{$.UrfaveCLINamespace}}FlagNames(f.Name, f.Aliases) | ||
return {{$.UrfaveCLINamespace}}FlagNames(f.Name, f.Aliases) | ||
} | ||
|
||
{{end}}{{/* /if .GenerateFlagInterface */}} | ||
|
||
{{if .GenerateRequiredFlagInterface}} | ||
{{- if .GenerateRequiredFlagInterface -}} | ||
// IsRequired returns whether or not the flag is required | ||
func (f *{{.TypeName}}) IsRequired() bool { | ||
return f.Required | ||
return f.Required | ||
} | ||
|
||
{{end}}{{/* /if .GenerateRequiredFlagInterface */}} | ||
|
||
{{if .GenerateVisibleFlagInterface}} | ||
{{- if .GenerateVisibleFlagInterface -}} | ||
// IsVisible returns true if the flag is not hidden, otherwise false | ||
func (f *{{.TypeName}}) IsVisible() bool { | ||
return !f.Hidden | ||
} | ||
{{end}}{{/* /if .GenerateVisibleFlagInterface */}} | ||
{{end}}{{/* /range .SortedFlagTypes */}} | ||
|
||
// vim{{/* 👻 */}}:ro | ||
{{/* | ||
{{- "// vim"}}:ro | ||
{{- /* 👻 | ||
vim:filetype=gotexttmpl | ||
*/}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters