Documentation
¶
Index ¶
- Variables
- func BindCommonFlags(cmd *cobra.Command, withOutput bool)
- func BindDefaultFlags(cmd *cobra.Command)
- func BindLoginOutputFlags(cmd *cobra.Command)
- func BindLoginRepoFlags(cmd *cobra.Command)
- func BindNotificationFlags(cmd *cobra.Command)
- func BindPageFlags(cmd *cobra.Command)
- func GetListOptions() kmup.ListOptions
- func Reset()
- type CsvFlag
Constants ¶
This section is empty.
Variables ¶
var ( // RepoFlag stores the value of --repo flag RepoFlag string // LoginFlag stores the value of --login flag LoginFlag string // RemoteFlag stores the value of --remote flag RemoteFlag string // OutputFlag stores the value of --output flag OutputFlag string )
Common flag variables (exported for external access)
var Mime bool
var NotificationStateFlag = NewCsvFlag( "states", "notification states to filter by", []string{"s"}, []string{"pinned", "unread", "read"}, []string{"unread", "pinned"}, )
NotificationStateFlag is a csv flag applied to all notification subcommands as filter
Functions ¶
func BindCommonFlags ¶
BindCommonFlags binds all common flags to the given command cmd: Command instance to bind flags withOutput: Whether to enable --output flag (some commands may not need it)
func BindDefaultFlags ¶
func BindLoginOutputFlags ¶
LoginOutputFlags defines login and output flags that should added to all subcommands and appended to the flags of the subcommand to work around issue and provide --login and --output:
func BindLoginRepoFlags ¶
func BindNotificationFlags ¶
func BindPageFlags ¶
func GetListOptions ¶
func GetListOptions() kmup.ListOptions
GetListOptions returns configured paging struct
Types ¶
type CsvFlag ¶
type CsvFlag struct {
Name string
Aliases []string
Value string
Usage string
AvailableFields []string
}
CsvFlag is a wrapper around cli.StringFlag, with an added GetValues() method to retrieve comma separated string values as a slice.
func FieldsFlag ¶
FieldsFlag generates a flag selecting printable fields. To retrieve the value, use f.GetValues()
func NewCsvFlag ¶
NewCsvFlag creates a CsvFlag, while setting its usage string and default values