Documentation ¶
Index ¶
- Constants
- func AddProjectFlags(cmd *cobra.Command, f Factory)
- func GetWeekdays() []string
- func RequiredNamedArgs(names ...string) cobra.PositionalArgs
- func XorFlag(exclusiveFlags map[string]bool) error
- func XorFlagSet(f *pflag.FlagSet, exclusiveFlags ...string) error
- type Config
- type Factory
- type FlagError
- type Version
Constants ¶
View Source
const ( CONF_WORKWEEK_DAYS = "workweek-days" CONF_INTERACTIVE = "interactive" CONF_ALLOW_NAME_FOR_ID = "allow-name-for-id" CONF_USER_ID = "user.id" CONF_WORKSPACE = "workspace" CONF_TOKEN = "token" CONF_ALLOW_INCOMPLETE = "allow-incomplete" CONF_SHOW_TASKS = "show-task" CONF_DESCR_AUTOCOMP = "description-autocomplete" CONF_DESCR_AUTOCOMP_DAYS = "description-autocomplete-days" CONF_SHOW_TOTAL_DURATION = "show-total-duration" CONF_LOG_LEVEL = "log-level" CONF_ALLOW_ARCHIVED_TAGS = "allow-archived-tags" )
View Source
const ( LOG_LEVEL_NONE = "none" LOG_LEVEL_DEBUG = "debug" LOG_LEVEL_INFO = "info" )
Variables ¶
This section is empty.
Functions ¶
func AddProjectFlags ¶
AddProjectFlags creates a project flag with autocomplete configured
func RequiredNamedArgs ¶
func RequiredNamedArgs(names ...string) cobra.PositionalArgs
RequiredNamedArgs will fail if the number of arguments received is less than the length of the parameter `names`, and will show the help explaining required named arguments
Types ¶
type Config ¶
type Config interface { GetBool(string) bool SetBool(string, bool) GetInt(string) int SetInt(string, int) GetString(string) string SetString(string, string) GetStringSlice(string) []string SetStringSlice(string, []string) IsDebuging() bool IsAllowNameForID() bool IsInteractive() bool GetWorkWeekdays() []string Get(string) interface{} All() map[string]interface{} LogLevel() string Save() error }
Config manages configs and parameters used locally by the CLI
type Factory ¶
type Factory interface { Version() Version Config() Config Client() (api.Client, error) GetUserID() (string, error) GetWorkspaceID() (string, error) GetWorkspace() (dto.Workspace, error) }
Factory is a container/factory builder for the commands and its helpers
func NewFactory ¶
type FlagError ¶
type FlagError struct {
// contains filtered or unexported fields
}
FlagError happens when a non-cobra validation fails
func FlagErrorWrap ¶
Click to show internal directories.
Click to hide internal directories.