mirror of
https://github.com/jimeh/mje.git
synced 2026-02-19 09:56:41 +00:00
refactor(commands): split commands package into multiple sub-packages
This commit is contained in:
13
commands/shared/flag_string.go
Normal file
13
commands/shared/flag_string.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package shared
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
func FlagString(cmd *cobra.Command, name string) string {
|
||||
var r string
|
||||
|
||||
if f := cmd.Flag(name); f != nil {
|
||||
r = f.Value.String()
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
Reference in New Issue
Block a user