From b1af8fd87760b34e3ff2fd3bda38f211815a0473 Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Sun, 9 Mar 2025 17:47:56 +0100 Subject: [chore] remove vendor --- vendor/github.com/spf13/pflag/func.go | 37 ----------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 vendor/github.com/spf13/pflag/func.go (limited to 'vendor/github.com/spf13/pflag/func.go') diff --git a/vendor/github.com/spf13/pflag/func.go b/vendor/github.com/spf13/pflag/func.go deleted file mode 100644 index 9f4d88f27..000000000 --- a/vendor/github.com/spf13/pflag/func.go +++ /dev/null @@ -1,37 +0,0 @@ -package pflag - -// -- func Value -type funcValue func(string) error - -func (f funcValue) Set(s string) error { return f(s) } - -func (f funcValue) Type() string { return "func" } - -func (f funcValue) String() string { return "" } // same behavior as stdlib 'flag' package - -// Func defines a func flag with specified name, callback function and usage string. -// -// The callback function will be called every time "--{name}={value}" (or equivalent) is -// parsed on the command line, with "{value}" as an argument. -func (f *FlagSet) Func(name string, usage string, fn func(string) error) { - f.FuncP(name, "", usage, fn) -} - -// FuncP is like Func, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) FuncP(name string, shorthand string, usage string, fn func(string) error) { - var val Value = funcValue(fn) - f.VarP(val, name, shorthand, usage) -} - -// Func defines a func flag with specified name, callback function and usage string. -// -// The callback function will be called every time "--{name}={value}" (or equivalent) is -// parsed on the command line, with "{value}" as an argument. -func Func(name string, usage string, fn func(string) error) { - CommandLine.FuncP(name, "", usage, fn) -} - -// FuncP is like Func, but accepts a shorthand letter that can be used after a single dash. -func FuncP(name, shorthand string, usage string, fn func(string) error) { - CommandLine.FuncP(name, shorthand, usage, fn) -} -- cgit v1.2.3