Documentation ¶
Index ¶
- Variables
- func ActionAct(c *cli.Context) error
- func ActionAdd(c *cli.Context) error
- func ActionBackupList(c *cli.Context) error
- func ActionBackupRun(c *cli.Context) error
- func ActionComplete(c *cli.Context) error
- func ActionDelete(c *cli.Context) error
- func ActionInitBash(c *cli.Context) error
- func ActionInitPs1(c *cli.Context) error
- func ActionList(c *cli.Context) error
- func ActionNotify(c *cli.Context) error
- func ActionSetupBackup(c *cli.Context) error
- func ActionSetupNew(c *cli.Context) (err error)
- func ActionSetupShell(c *cli.Context) error
- func ActionSetupShow(c *cli.Context) error
- func ActionSetupSync(c *cli.Context) error
- func ActionSync(c *cli.Context) error
- func ActionUpdate(c *cli.Context) error
- func App() *cli.App
- func GetCommandSetupBackup() *cli.Command
- func GetCommandSetupNew() *cli.Command
- func GetCommandSetupShell() *cli.Command
- func GetCommandSetupShow() *cli.Command
- func GetCommandSetupSync() *cli.Command
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ListAll = false ListDone = false ListCommand = &cli.Command{ Name: "list", Aliases: []string{"l"}, Usage: "List all todo items", Category: "Tasks", Before: ctx.ChainedContext(ctx.AssertLocalConfig, ctx.AssertAutoSychronization, ctx.OptionalId), Flags: []cli.Flag{ &cli.IntFlag{ Name: "id", Aliases: []string{"i"}, Usage: "List a specific item", Required: false, }, &cli.BoolFlag{ Name: "all", Aliases: []string{"a"}, Usage: "List all tasks", }, &cli.BoolFlag{ Name: "done", Aliases: []string{"d"}, Usage: "List all done tasks", }, &cli.BoolFlag{ Name: "pending", Aliases: []string{"p"}, Usage: "List all pending tasks", }, &cli.StringSliceFlag{ Name: "tags", Aliases: []string{"t"}, Usage: "List all tasks with the specified tags", }, &cli.BoolFlag{ Name: "no-header", Usage: "Do not print the header", }, }, Action: ActionList, } )
View Source
var ( AppName = "todo-cli" Version = "0.0.1" BuildHost = "dev" BuildDate = "2021-08-01T00:00:00Z" AppDescription = AppName + " v" + Version )
View Source
var ( ActCommand = &cli.Command{ Name: "act", Usage: "Set current timestamp as action for item", Aliases: []string{"a"}, Before: ctx.ChainedContext(ctx.AssertLocalConfig, ctx.AssertAutoSychronization), Action: ActionAct, ArgsUsage: "[todo-id]", Category: "Tasks", After: ctx.ChainedContext(ctx.AssertSave, ctx.AssertAutoSychronization), } )
View Source
var ( AddCommand = &cli.Command{ Name: "add", Usage: "Add a new todo item", Aliases: []string{"a"}, Before: ctx.ChainedContext(ctx.AssertLocalConfig, ctx.AssertAutoSychronization), Action: ActionAdd, Category: "Tasks", Flags: []cli.Flag{ &cli.StringFlag{ Name: "title", Aliases: []string{"t"}, Usage: "Title of the task", Required: true, }, &cli.TimestampFlag{ Name: "due-date", Aliases: []string{"d"}, Usage: "Due date for the todo item", Layout: "2006-01-02", Required: false, }, &cli.StringSliceFlag{ Name: "tags", Usage: "Tags for the todo item", Required: false, }, &cli.IntFlag{ Name: "parent-id", Usage: "Parent ID for the todo item", Required: false, Aliases: []string{"p"}, }, }, After: ctx.ChainedContext(ctx.AssertSave, ctx.AssertSychronization), } )
View Source
var ( BackupCommand = &cli.Command{ Name: "backup", Usage: "Run a backup of the todo list", Aliases: []string{"a"}, Before: ctx.ChainedContext(ctx.AssertLocalConfig, ctx.AssertAutoSychronization), Category: "Tasks", Flags: []cli.Flag{ &cli.StringFlag{ Name: "path", Aliases: []string{"p"}, Usage: "Path to backup directory", Required: false, Value: path.Join(ctx.GetDefaultDataFolder(), "backup"), }, }, Subcommands: []*cli.Command{ { Name: "run", Usage: "Run a backup of the todo list", Action: ActionBackupRun, }, { Name: "list", Usage: "List all backups", Action: ActionBackupList, }, }, } )
View Source
var ( CompleteCommand = &cli.Command{ Name: "complete", Usage: "Complete a todo item", Aliases: []string{"c"}, Action: ActionComplete, Category: "Tasks", ArgsUsage: "[todo-id]", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "undo", Aliases: []string{"u"}, Usage: "Undo a completed todo item", }, }, Before: ctx.ChainedContext(ctx.AssertLocalConfig, ctx.AssertValidId), After: ctx.ChainedContext(ctx.AssertSave, ctx.AssertAutoSychronization), } )
View Source
var ( DeleteCommand = &cli.Command{ Name: "delete", Usage: "Delete a todo item", Aliases: []string{"d"}, Action: ActionDelete, Category: "Tasks", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "force", Aliases: []string{"f"}, Usage: "Force delete without confirmation", }, }, Before: ctx.ChainedContext(ctx.AssertLocalConfig, ctx.AssertValidId), After: ctx.ChainedContext(ctx.AssertSave, ctx.AssertAutoSychronization), } )
View Source
var ( InitCommand = &cli.Command{ Name: "init", Usage: "Outputs the shell initialization script", Category: "Tasks", Subcommands: []*cli.Command{ { Name: "bash", Action: ActionInitBash}, { Name: "ps1", Action: ActionInitPs1, Flags: []cli.Flag{ &cli.IntFlag{ Name: "period", Usage: "Period in seconds to show notifications", Value: 60, }, }, }, }, } )
View Source
var (
NotifyCommand *cli.Command
)
View Source
var (
SetupCommand *cli.Command
)
View Source
var ( SyncCommand = &cli.Command{ Name: "sync", Usage: "Synchronize local collection with GIST", Aliases: []string{"s"}, Action: ActionSync, Category: "Setup", Before: ctx.ChainedContext(ctx.AssertLocalConfig), After: ctx.AssertSave, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "simulate", Usage: "Just for testing", Required: false, }, }, } )
View Source
var ( UpdateCommand = &cli.Command{ Name: "update", Usage: "Update a todo item", Aliases: []string{"u"}, Action: ActionUpdate, Category: "Tasks", Before: ctx.ChainedContext(ctx.AssertLocalConfig, ctx.AssertValidId), Flags: []cli.Flag{ &cli.IntFlag{ Name: "id", Aliases: []string{"i"}, Usage: "ID of the task", Required: true, }, &cli.StringFlag{ Name: "title", Usage: "Title of the task", Required: false, }, &cli.TimestampFlag{ Name: "due-date", Aliases: []string{"d"}, Usage: "Due date for the todo item", Layout: "2006-01-02", Required: false, }, &cli.StringSliceFlag{ Name: "tags", Aliases: []string{"t"}, Usage: "Tags for the todo item", Required: false, }, &cli.IntFlag{ Name: "parent-id", Usage: "Parent ID for the todo item", Required: false, Aliases: []string{"p"}, }, }, After: ctx.ChainedContext(ctx.AssertSave, ctx.AssertSychronization), } )
Functions ¶
func ActionBackupList ¶
func ActionBackupList(c *cli.Context) error
func ActionBackupRun ¶
func ActionBackupRun(c *cli.Context) error
func ActionComplete ¶
func ActionComplete(c *cli.Context) error
func ActionDelete ¶
func ActionDelete(c *cli.Context) error
func ActionInitBash ¶
func ActionInitBash(c *cli.Context) error
func ActionInitPs1 ¶
func ActionInitPs1(c *cli.Context) error
func ActionList ¶
func ActionList(c *cli.Context) error
func ActionNotify ¶
func ActionNotify(c *cli.Context) error
func ActionSetupBackup ¶
func ActionSetupBackup(c *cli.Context) error
func ActionSetupNew ¶
func ActionSetupNew(c *cli.Context) (err error)
func ActionSetupShell ¶
func ActionSetupShell(c *cli.Context) error
func ActionSetupShow ¶
func ActionSetupShow(c *cli.Context) error
func ActionSetupSync ¶
func ActionSetupSync(c *cli.Context) error
func ActionSync ¶
func ActionSync(c *cli.Context) error
func ActionUpdate ¶
func ActionUpdate(c *cli.Context) error
func GetCommandSetupBackup ¶
func GetCommandSetupBackup() *cli.Command
func GetCommandSetupNew ¶
func GetCommandSetupNew() *cli.Command
func GetCommandSetupShell ¶
func GetCommandSetupShell() *cli.Command
func GetCommandSetupShow ¶
func GetCommandSetupShow() *cli.Command
func GetCommandSetupSync ¶
func GetCommandSetupSync() *cli.Command
Types ¶
This section is empty.
Source Files ¶
- action_act.go
- action_add.go
- action_backup.go
- action_complete.go
- action_delete.go
- action_init.go
- action_list.go
- action_notify.go
- action_setup.go
- action_setup_backup.go
- action_setup_new.go
- action_setup_shell.go
- action_setup_show.go
- action_setup_sync.go
- action_sync.go
- action_update.go
- build_data.go
- cli_setup.go
- inputs.go
Click to show internal directories.
Click to hide internal directories.