Add TakesFile to fish shell completion

The new `TakesFile` flag will be now consumed by the fish shell
completion generator.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
Sascha Grunert
2019-08-12 09:42:12 +02:00
committed by Sascha Grunert
parent fa6797beef
commit a1cf7f44b6
7 changed files with 121 additions and 25 deletions

View File

@@ -60,6 +60,12 @@ func (f {{ $flag.Name }}Flag) GetValue() string {
{{ $flag.ValueString }}
}
// GetValue returns the flags value as string representation and an empty
// string if the flag takes no value at all.
func (f {{ $flag.Name }}Flag) GetTakesFile() bool {
{{ if eq $flag.TakesFile true }}return f.TakesFile{{ else }}return false{{ end }}
}
// {{ $flag.Name }} looks up the value of a local {{ $flag.Name }}Flag, returns
// {{ $flag.ContextDefault }} if not found
func (c *Context) {{ $flag.Name }}(name string) {{ if ne .ContextType "" }}{{ $flag.ContextType }}{{ else }}{{ $flag.Type }}{{- end }} {