aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/internal/util/cmd.go
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:55 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:55 +0800
commitfc8c5fdce62fb229202659408798a7b6c98f6e8b (patch)
tree7554f80e50de4af6fd255afa7c21bcdd58a7af34 /cli/internal/util/cmd.go
parentdd84b9d64fb98746a230cd24233ff50a562c39c9 (diff)
downloadHydroRoll-fc8c5fdce62fb229202659408798a7b6c98f6e8b.tar.gz
HydroRoll-fc8c5fdce62fb229202659408798a7b6c98f6e8b.zip
Diffstat (limited to 'cli/internal/util/cmd.go')
-rw-r--r--cli/internal/util/cmd.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/cli/internal/util/cmd.go b/cli/internal/util/cmd.go
deleted file mode 100644
index ae79aa0..0000000
--- a/cli/internal/util/cmd.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package util
-
-import (
- "bytes"
-
- "github.com/spf13/cobra"
-)
-
-// ExitCodeError is a specific error that is returned by the command to specify the exit code
-type ExitCodeError struct {
- ExitCode int
-}
-
-func (e *ExitCodeError) Error() string { return "exit code error" }
-
-// HelpForCobraCmd returns the help string for a given command
-// Note that this overwrites the output for the command
-func HelpForCobraCmd(cmd *cobra.Command) string {
- f := cmd.HelpFunc()
- buf := bytes.NewBufferString("")
- cmd.SetOut(buf)
- f(cmd, []string{})
- return buf.String()
-}