ToDonePy command-line interface (CLI)¶
Root Command: to¶
The root to command
The root command provides several options.
-s/–sort allows you to specify how to sort added or returned tasks. Bear in mind that this sorts the underlying file! It defaults to ‘none’ - best not to do anything unless you need to!
-f/file allows you to specify where to store your TODOs. If you don’t specify, it defaults to ~/.todo.tsv and will create the file if it doesn’t exists. If you want to keep your file elsewhere, you can specify that with the env var TODO_FILE
Like all good CLIs, -v/–version returns the version while -h/–help help for the root command. Help for the subcommands can be found by calling -h after a subcommand, like this: to do -h.
-
commands.to.
__version__
¶ The version number, pulled from the pyproject.toml file
- Type
str
Sub-Command: do¶
-
subcommands.do.
do
(args: argparse.Namespace) → None¶ Add some tasks to your list
do supports an unlimited number of tasks, but requires that tasks of more than 1 word in length be enclosed in quotes. Single or double are fine - use whichever! To keep track of how long tasks have been on the list, a timestamp of the form %y-%m-%d %H:%M is also added.
Notes
All tasks added at the same time will be added at the same rank. If you need to add multiple tasks at different ranks, you must call to do multiple times.
- Parameters
args (argparse.Namespace) – Arguments forwarded from the CLI. For this subcommand, this includes:
args.file (Filer) – The TODO file to add to. From the root to command
args.rank (int) – The importance to assign the new tasks.
args.sort (Literal[“rank”, “date”, “both”, “none”]) – How to sort new tasks added to the list. From the root to command
args.tasks (List[str]) – The task(s) to add to your list
- Returns
None – However, a confirmation message will be echoed to the terminal
Examples
$ to -s rank do 2 “An example task” “I’m very busy”
Sub-Command: doing¶
-
subcommands.doing.
doing
(args: argparse.Namespace) → None¶ See tasks in your list
Notes
–edit opens whatever editor is specified by your EDITOR env var. If one is not set, it will default to Vim.
Currently, –reminder has a dependency on notify-send. If this command is absent from your system, it will failt
- Parameters
args (argparse.Namespace) – Args passed from argparse. For this subcommand, these include:
args.file (Filer) – The TODO file to echo. Derived from the root to command
args.sort (Literal[‘both’, ‘none’, rank’, ‘date’]) – How to sort echoed tasks. Derived from the root to command
args.number (int) – How many tasks to return
args.reminder (bool) – Whether to use notify-send to create a pop-up
args.edit (bool) – Whether to laucn an editor with your TODO file
- Returns
None
Example
$ to doing -n 3
Sub-Command: done¶
The done subcommand for the to main command
-
subcommands.done.
done
(args: argparse.Namespace) → None¶ Remove a task to your list
This command uses the supplied tasks to look for matches in your TODO list. A helpful message lets you know if the task(s) was(were) found and deleted.
Note
If your task contains more than one word, then each task must be enclosed in quotes. Otherwise, the CLI treats each word as a task. Also note that if multiple lines match a task, they will ALL be deleted.
- Parameters
args (argparse.Namespace) – Arguments forwarded from the CLI. For this subcommand, this includes:
args.file (Filer) – The TODO file to be searched. From the root to command
args.task (List[str]) – The list of tasks to be deleted
- Returns
None – Though a message will be echoed letting you know if the task(s) was(were) deleted successfully.
Example
$ to done ‘An example’ ‘Is always helpful’