命令行应用程序,显示从todo.txt文件执行的下一个操作

next-action的Python项目详细描述


下一步-操作

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<亚胺米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米米F6E2F7369656C642E737667" /><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<亚胺咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪咪716E63683D6D6173746572" />

从todo.txt文件中的操作列表中确定要处理的下一个操作。

不知道todo.txt是什么?有关todo.txt规范,请参见https://github.com/todo txt/todo.txt" rel="nofollow">https://github.com/todo txt/todo.txt。

下一步-action不是编辑todo.txt文件的工具,有关可用选项,请参见http://todo txt.org。

目录

演示

gif

安装

下一步行动

下一个操作需要Python3.6或更新版本。

PIP安装--升级下一步操作

下一个操作的制表符完成

要在bash shell中安装下一个操作的tab completion,请执行以下步骤:

  • 下载extra/.next action completion.bash 并将其保存在主文件夹中。

  • 接下来,将这一行添加到您的~/.bash_配置文件中文件:

    source ~/.next-action-completion.bash
    
  • 然后,打开一个新终端。

键入下一个操作[tab]应该会提供可能的命令行选项。在一个选项后按Tab键 参数,显示可能的参数。

用法

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.

假设您的todo.txt文件在主文件夹中,运行不带参数的下一个操作将显示下一个操作 你应该这么做。例如,假设 todo.txt,下一个是给妈妈打电话 动作:

$ next-action
(A) Call mom @phone

下一个操作是使用优先级确定的。在优先级之后考虑到期日期,任务在优先级之前到期 优先于以后到期的任务。创建日期被视为晚于到期日期,较旧的任务优先于 新任务。最后,属于更多项目的任务优先于属于较少项目的任务。

有几种类型的任务不能作为下一个操作:

  • 已完成的任务(x这是已完成的任务),
  • 具有未来创建日期的任务(9999-01-01开始准备五位数年份),
  • 具有未来阈值日期的任务(开始准备移民到mars t:3000-01-01),
  • 被阻止的任务(请参见下面的任务依赖项和
  • 隐藏任务(这是隐藏任务h:1)。

限制从中选择下一个操作的任务

根据上下文和/或项目

您可以通过传递上下文和/或项目来限制下一个操作从中选择下一个操作的任务:

$ next-action @work
(C) Finish proposal for important client @work$ next-action +DogHouse
(G) Buy wood for new +DogHouse @store$ next-action +DogHouse @home
Get rid of old +DogHouse @home

当您提供多个上下文和/或项目时,下一个操作属于所有上下文,并且至少属于 项目:

$ next-action +DogHouse +PaintHouse @store @weekend
(B) Buy paint to +PaintHouse @store @weekend

也可以排除上下文,这意味着下一个操作将没有指定的上下文:

$ next-action +PaintHouse -@store
Borrow ladder from the neighbors +PaintHouse @home

当然,同样,项目也可以排除在外:

$ next-action -+PaintHouse @store
(G) Buy wood for new +DogHouse @store

如果没有任务与任务和项目的组合匹配,则是时候喝杯咖啡了:

$ next-action +DogHouse @weekend
Nothing to do! ?

如果由于使用to do.txt文件中不存在的上下文或项目而无需执行任何操作,下一步操作 将警告您:

$ next-action +PaintGarage @freetime
Nothing to do! (warning: unknown context: freetime; unknown project: PaintGarage)

截止日期

要将从中选择下一个操作的任务限制为具有截止日期的操作,请使用--due选项:

source ~/.next-action-completion.bash
0

添加截止日期以从该日期或之前到期的任务中选择下一个操作:

source ~/.next-action-completion.bash
1

以确保你没有逾期行为,或工作逾期首先,限制下一个动作的任务 已选择到过期操作:

source ~/.next-action-completion.bash
2

按优先级

为了确保您处理的是重要任务而不是紧急任务,您可以确保 选定的下一个操作至少具有最低优先级:

source ~/.next-action-completion.bash
3

显示多个下一个操作

要显示多个下一个操作,请提供您认为可以处理的号码:

source ~/.next-action-completion.bash
4

或显示所有后续操作,例如针对特定上下文:

source ~/.next-action-completion.bash
5

再次注意,已完成的任务、具有未来创建日期或阈值日期的任务以及被阻止的任务永远不会是下一个 动作,

任务相关性

下一个操作在确定下一个操作时考虑任务依赖关系。例如,做饭 取决于是否购买日用品,以及是否在烹调完饭菜后才洗碗,可以指定如下:

source ~/.next-action-completion.bash
6

这意味着,购买食品杂货会阻碍做饭;做饭,因此也做不了菜。 在购买完日用品之前:

source ~/.next-action-completion.bash
7

请注意,尽管购买日用品没有到期日,但在倒垃圾之前购买日用品是如何到来的。 倒垃圾就行了。因为在烹调食物和烹调食物之前,必须先购买日用品 到期日,购买日用品的到期日与做饭的到期日相同。优先权在 类似的方式。

要显示下一个操作阻止了哪些任务,请使用--blocked选项:

source ~/.next-action-completion.bash
8

如果始终希望看到下一个操作阻止的任务,可以在配置中配置 文件。请参见下面关于如何配置下一个操作的部分

附加说明:

  • id可以是任何没有空格的字符串。
  • 您也可以使用p(对于"parent")而不是之前的,因为使用todo.txt文件的其他一些工具 使用它。
  • 一个任务可以通过重复before键来阻止多个其他任务, 例如:在烹饪之前和发送邀请之前购买日用品
  • 通过重复after键,一个任务可以被多个其他任务阻止, 例如:饭后:烹饪和饭后:设置餐桌
  • 如果任务阻止了一个或多个任务,则阻止任务将采用其正在阻止的任务的优先级和到期日期:
    • 阻塞任务的优先级是其自身优先级的最大值,并且 它正在阻塞的任务,并且
    • 阻塞任务被认为有一个到期日,它是自身到期日和 它正在阻塞的任务。

设置输出样式

默认情况下,下一个操作引用从中读取操作的todo.txt文件(如果从多个 todo.txt文件。--reference选项控制此操作:

source ~/.next-action-completion.bash
9

使用--reference never关闭此行为。要永久更改此设置,请在 配置文件。请参见下面关于如何配置下一个操作的部分

下一个操作可以使用--style参数进行着色。运行下一个操作--帮助 风格:

当您决定了您喜欢的样式时,在配置文件中配置该样式是有意义的。见 下面一节介绍如何配置下一个操作

不向--style传递参数将取消配置文件中配置的样式(如果有的话)。

当显示多个下一个操作时,可以通过传递--groupby选项对这些操作进行分组:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
0

下一个动作根据组中最重要的下一个动作对组进行排序。动作可以重复 如果它们属于多个组,就像购买油漆de>以上任务。

如果始终希望对下一个操作进行分组,可以在配置文件中对此进行配置。见章节 下面介绍如何配置下一个操作

配置下一个操作

除了在命令行上指定选项外,还可以在配置文件中配置选项。这个 配置文件格式为yaml。当前支持的选项是哪些todo.txt文件必须是 请阅读,接下来应该显示多少个操作、输出样式、上下文和/或项目筛选器。

写入配置文件

要开始,您可以告诉下一步操作使用默认选项生成配置文件:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
1

要使此配置成为默认读取的下一个action配置,请将输出重定向到~/.next action.cfglike 这:下一个操作--写入配置文件>;~/.next action.cfg

在命令行上指定的任何其他选项都用于生成配置文件:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
2

读取配置文件

默认情况下,下一个操作尝试读取名为 .next action.cfg在家中 文件夹.

如果要使用不在默认位置的配置文件(~/.next action.cfg),则需要 明确指定其位置:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
3

若要跳过读取默认配置文件,同时也不读取替代配置文件,请使用 --配置文件无参数选项。

配置默认的todo.txt

可以在配置文件中这样指定要使用的默认todo.txt文件:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
4

如果需要,可以列出多个todo.txt文件:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
5

配置要显示的下一个操作数

接下来要显示的操作数可以如下指定:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
6

或者您可以让下一个操作显示所有下一个操作:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
7

配置从中选择下一个操作的任务

受环境和/或项目的限制

通过指定要筛选的上下文和/或项目,可以限制从中选择下一个操作的任务, 就像在命令行中一样:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
8

这将使下一个操作默认情况下,从具有@work上下文且没有 @等待上下文,不属于+未来项目

另一种语法是:

$ next-action --help
Usage: next-action [-h] [-V] [-c [<config.cfg>] | -w] [-f <todo.txt> ...] [-b] [-g [<group>]] [-r <ref>] [-s[<style>]] [-a | -n <number>] [-d [<due date>] | -o] [-p [<priority>]] [--] [<context|project> ...]Show the next action in your todo.txt. The next action is selected from the tasks in the todo.txt file basedon task properties such as priority, due date, and creation date. Limit the tasks from which the next actionis selected by specifying contexts the tasks must have and/or projects the tasks must belong to.Optional arguments:  -h, --help            show this help message and exit  -V, --version         show program's version number and exitConfiguration options:  -c [<config.cfg>], --config-file [<config.cfg>]                        filename of configuration file to read (default: ~/.next-action.cfg); omit filename                        to not read any configuration file  -w, --write-config-file                        generate a sample configuration file and exitInput options:  -f <todo.txt>, --file <todo.txt>                        filename of todo.txt file to read; can be '-' to read from standard input; argument                        can be repeated to read tasks from multiple todo.txt files (default: ~/todo.txt)Output options:  -b, --blocked         show the tasks blocked by the next action, if any (default: False)  -g [<group>], --groupby [<group>]                        group the next actions; available groups: context, duedate, priority, project,                        source (default: None)  -r {always,never,multiple}, --reference {always,never,multiple}                        reference next actions with the name of their todo.txt file (default: when reading                        multiple todo.txt files)  -s [<style>], --style [<style>]                        colorize the output; available styles: abap, algol, algol_nu, arduino, autumn,                        borland, bw, colorful, default, emacs, friendly, fruity, igor, lovelace, manni,                        monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, rainbow_dash,                        rrt, sas, solarized-dark, solarized-light, stata, stata-dark, stata-light, tango,                        trac, vim, vs, xcode (default: None)Show multiple next actions:  -a, --all             show all next actions  -n <number>, --number <number>                        number of next actions to show (default: 1)Limit the tasks from which the next actions are selected:  -d [<due date>], --due [<due date>]                        show only next actions with a due date; if a date is given, show only next actions                        due on or before that date  -o, --overdue         show only overdue next actions  -p [<priority>], --priority [<priority>]                        minimum priority (A-Z) of next actions to show (default: None)  @<context> ...        contexts the next action must have  +<project> ...        projects the next action must be part of; if repeated the next action must be part                        of at least one of the projects  -@<context> ...       contexts the next action must not have  -+<project> ...       projects the next action must not be part ofUse -- to separate options with optional arguments from contexts and projects, in order to handle caseswhere a context or project is mistaken for an argument to an option.
9

请注意,以@开头的筛选器需要用引号括起来。这是一个 yaml限制

按优先级限制

接下来要显示的操作的最小优先级也可以指定:

$ next-action
(A) Call mom @phone
0

例如,如果您在todo.txt文件中保留一个没有优先级的思想积压,并且 只对可执行的任务进行优先级排序。

在命令行上指定一个值将覆盖配置文件中的优先级,例如 下一个操作--优先级C。要覆盖配置中设置的优先级,但不设置另一个最小优先级, 使用priority选项而不带参数:下一个操作--priority

配置输出

可以配置下一个操作是否应该引用从中读取它们的todo.txt文件 使用参考关键字:

$ next-action
(A) Call mom @phone
1

可能的值是alwaysnevermultiple。后者意味着文件名只在您读取 来自多个todo.txt文件的任务。默认值为multiple

可以使用style关键字配置输出样式:

$ next-action
(A) Call mom @phone
2

运行下一个操作--帮助风格:

若要始终查看下一个操作阻止的任务,请将其放入配置文件:

$ next-action
(A) Call mom @phone
3

接下来的操作可以配置为按以下方式分组:

$ next-action
(A) Call mom @phone
4

可能的分组选项有contextduedatepriorityprojectsource。指定上的值 命令行覆盖配置文件中的分组,例如下一个操作--groupby project。 要同时取消配置文件中的分组集,请使用不带参数的groupby选项: 下一个操作--groupby

选项详细信息

优先级

配置文件中的选项将覆盖默认选项。命令行选项依次替代 配置文件。

如果您有一个带有默认选项的配置文件,并且您偶尔希望忽略它,则可以跳过读取 完全使用--no config file选项的配置文件。

可选参数后跟位置参数

如果使用的选项带有可选参数,但后跟位置参数,下一步操作 将把位置参数解释为选项的参数并抱怨,例如:

$ next-action
(A) Call mom @phone
5

有两种方法可以帮助你理解你的意思。或者颠倒参数的顺序:

source ~/.next-action-completion.bash
0

或者使用--将选项与位置参数分开:

$ next-action
(A) Call mom @phone
7

最近的更改

请参阅更改日志

制定下一步行动

安装开发环境和依赖项

我们使用Docker作为开发环境。要构建包含所有开发依赖项的Docker映像,请确保 你已经安装了Git和Docker。然后,执行以下步骤:

  • 克隆存储库:git clone https://github.com/fniessink/next action.git
  • 输入文件夹:cd next action
  • 建立docker镜像:docker build。-t下一个动作dev

docker compose.yml包含每个开发工具的服务。下面将介绍这些功能。

运行单元测试

运行单元测试并检查其代码覆盖率:

$ next-action
(A) Call mom @phone
8

HTML覆盖率报告将写入build/unittest coverage/

运行功能测试

运行功能测试并测量其代码覆盖率:

$ next-action
(A) Call mom @phone
9

HTML覆盖率报告将写入build/feature coverage/

运行质量检查

mypy、pylint、pycodestyle、pydocstyle、bandit、pyroma和vulture工具用于检查 python代码。shellcheck用于计算bash代码。小黄瓜特征文件用小黄瓜绒布填充。 使用markdownlint计算标记文件。用hadolint检查dockerfile。docker-compose.yml是 与docker compose核对。

运行质量检查:

$ next-action @work
(C) Finish proposal for important client @work$ next-action +DogHouse
(G) Buy wood for new +DogHouse @store$ next-action +DogHouse @home
Get rid of old +DogHouse @home
0

生成文档

这个readme.md文件是用docker compose up docs生成的

下面的依赖关系图是用pydeps创建的,下面的包和类图是用 Pyreverse(Pylint的一部分)。

源代码结构和依赖关系

依赖关系图显示代码库中的包和模块与第三方之间的关系 使用的包。当用户从命令行imvokesnext action时,在 下一个操作包已运行。next_action()方法使用next_action.arguments包来解析 命令行参数和配置文件。使用 <代码> NEXt_action.todoxt包。next_action.pick_action模块包含选择下一个操作的逻辑。 最后,使用下一个操作对输出进行格式化。output包。

png

pyreverse创建的类图显示了使用的类。最大的一个是nextActionArgumentParser类, 负责分析命令行参数。其他两个相关的类是用于保存的任务类 有关单个任务和包含任务集合的任务类的信息。

png

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Dropbox java登录   java如何将“abcd1234”转换为INT1234   java如何实现compareTo()?   java如何查看SWT示例(Eclipse)源代码?   java内存直接映射到字符串   传递字符串时java Android应用程序崩溃   java是将Android游标(sqlite)提取到数组中以在AlertDialog中使用的最有效的方法。建设者   java如何检查udp/多播端口是否打开且可用?   如何在Java中创建弱引用?   java相同的异常针对不同的异常   swing Java JFrame问题与对话框   Eclipse Mars与Maven和SVN之间的java冲突?   如何在Java+swt中将对象停靠到父窗口?   如何区分Java输入类型?   java在Spring批处理中读取一个项目并将项目列表写入文件   java如何减少数据库表行整数值   java NullPointerException,即使对象不为null   如果站点地图的URL数超过maxnumber,则java会将其拆分为多个站点地图   java JFR显示LmaxDisruptor引擎内部的CPU利用率很高