accorder/cmd/commoners.go

23 lines
487 B
Go
Raw Normal View History

2021-10-30 23:25:44 +00:00
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
func CustomHelpOutput(cmd *cobra.Command) {
cmd.Flags().SortFlags = false
cmd.SetHelpTemplate(HelpTemplate)
cmd.SetUsageTemplate(UsageTemplate)
}
func OnlyProfileArgument(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("Please, provide PROFILE as the last argument.")
}
if len(args) > 1 {
return fmt.Errorf("You can only have one argument and that should be PROFILE.")
}
return nil
}