mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-05 08:17:25 -08:00
14 lines
263 B
Go
14 lines
263 B
Go
package cli
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
func NoArgsOrOneValidArg(cmd *cobra.Command, args []string) error {
|
|
if len(args) == 0 {
|
|
return nil
|
|
}
|
|
if err := cobra.ExactArgs(1)(cmd, args); err != nil {
|
|
return err
|
|
}
|
|
return cobra.OnlyValidArgs(cmd, args)
|
|
}
|