summaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/pflag/func.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2025-03-09 17:47:56 +0100
committerLibravatar Terin Stock <terinjokes@gmail.com>2025-12-01 22:08:04 +0100
commitb1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch)
tree9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/github.com/spf13/pflag/func.go
parent[chore] update URLs to forked source (diff)
downloadgotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/spf13/pflag/func.go')
-rw-r--r--vendor/github.com/spf13/pflag/func.go37
1 files changed, 0 insertions, 37 deletions
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)
-}