2do-cli 中文文档教程

发布于 5年前 浏览 39 项目主页 更新于 3年前

2do-cli Build StatusDownload-week

命令行待办事项应用程序。

Demo

Installation

npm i -g 2do-cli

或者,如果使用 Yarn:

yarn global add 2do-cli

Usage


Initializing

打开任何你想使用 2do-cli 内部的存储库。
然后输入:

2do


2do-cli 将启动,然后写入:

init


2do-cli 会在你的 repo 中生成一个 2do.json 文件。


Adding a file

要使用 2do-cli,您需要添加一个文件,然后添加与之相关的待办事项。
假设你有一个名为 main.js 的文件,你想为这个文件添加一些待办事项,为此(在你的 repo 中初始化 2do-cli 之后)你必须键入:

add main.js 'Here is my first todo for main.js' 


过了一会儿你可能知道你想为同一个文件添加另一个待办事项,所以只需使用相同的命令:

add main.js 'Here is my second todo for main.js '

Show todo

现在如果你想查看 main.js 的所有待办事项,你只需写:

show main.js


并且该文件的所有待办事项都会出现。


Check todo

那么,如果您想知道自己是否完成了待办事项怎么办。 每个待办事项都有默认的 status 字段, 它的值默认设置为 undone。 如果您想更改它以便知道您的待办事项已完成:

check main.js 4


这会将 main.js 的第四个待办事项的状态设置为 done


Listing

您可以列出当前目录中具有待办事项的所有文件,并通过键入以下内容来选择您想要的任何文件:

list

Removing

您可以删除一个文件,这也会删除所有的待办事项,或者您只能删除一个文件的待办事项,待办事项你刚刚写的前一个:

delete main.js


如果你只想删除这个文件的第二个待办事项,你可以这样:

delete main.js 2


上面的命令将删除 main.js 的第二个待办事项。


Version

要获取当前版本,只需键入:

version

2do-cli Build StatusDownload-week

Commnad line todo app.

Demo

Installation

npm i -g 2do-cli

Or if using Yarn:

yarn global add 2do-cli

Usage


Initializing

Open up any repository that you want to use 2do-cli indside.
Then type:

2do


2do-cli will start, after that write :

init


And 2do-cli will generate a 2do.json file in you repo.


Adding a file

To work with 2do-cli you have add a file and then todos related to that.
Lets say you have a file named main.js and you want to add some todos for this file, to do so (after inializing 2do-cli in your repo) you have to type:

add main.js 'Here is my first todo for main.js' 


After a while you might know that you want to add another todo for same file, so just use same command like:

add main.js 'Here is my second todo for main.js '

Show todo

Now if you want to see all todos of main.js you simply write:

show main.js


and all todos of that file will appear.


Check todo

So what if you want to know you have completed a todo or not. There is default status field for every todo, and it's value is set to undone by default. If you want to change it so that you know your todo is done:

check main.js 4


This will set status of fourth todo of main.js to done.


Listing

You can list all of files which have todos in current directory and select any one that you want, by typing :

list

Removing

You can remove a file, which removes all of it's todos too, or you can only remove a todo of a file, to do prior one you just write:

delete main.js


And if you want to remove only second todo of this file you go like:

delete main.js 2


Above command will remove second todo of main.js .


Version

To get current version just type :

version
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文