accorder/cmd/commoners.go

23 lines
487 B
Go

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
}