Skip to content

Commit 93d3e34

Browse files
committed
Add 'edit' command to open todo.txt folder in VS Code
1 parent 8866fb7 commit 93d3e34

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

Help.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ Marks task(s) on line ITEM# as done in todo.txt.
7777
todo do ITEM#[, ITEM#, ITEM#, ...]
7878
```
7979

80+
### `edit`
81+
Opens the folder containing the todo.txt file in VS Code.
82+
83+
```shell
84+
todo edit
85+
```
86+
8087
### `help`
8188
Display help about usage, options, built-in and add-on actions, or just the usage
8289
help for the passed ACTION(s).

Readme.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ remain faithful to the command line and functionality of the original shell scri
77
possible. As such, the [usage](#usage) below is a modified copy of the
88
[original on GitHub](https://github.com/todotxt/todo.txt-cli/blob/master/USAGE.md).
99

10-
- [Installation](#installation)
11-
- [Usage](#usage)
12-
- [Configuration](#configuration)
10+
- [Dotnet Todo.txt CLI](#dotnet-todotxt-cli)
11+
- [Installation](#installation)
12+
- [Enabling Tab Completion](#enabling-tab-completion)
13+
- [Usage](#usage)
14+
- [Commands](#commands)
15+
- [Warning](#warning)
16+
- [Configuration](#configuration)
1317

1418
## Installation
1519

@@ -41,6 +45,27 @@ For a complete list of options,
4145
todo --help
4246
```
4347

48+
### Commands
49+
50+
- **add**: Adds a task to your todo.txt file.
51+
- **addm**: Adds multiple tasks to your todo.txt file.
52+
- **addto**: Adds a line of text to any file located in the todo.txt directory.
53+
- **append**: Adds text to the end of a task.
54+
- **archive**: Moves all done tasks from todo.txt to done.txt and removes blank lines.
55+
- **delete**: Deletes a task or a term from a task.
56+
- **depri**: Deprioritizes (removes the priority) from tasks.
57+
- **edit**: Opens the folder containing the todo.txt file in VS Code.
58+
- **do**: Marks tasks as done in todo.txt.
59+
- **list**: Displays tasks that match terms sorted by priority.
60+
- **listall**: Displays all tasks in todo.txt and done.txt that match terms.
61+
- **listcon**: Lists all task contexts starting with @.
62+
- **listfile**: Displays tasks from a specific file that match terms.
63+
- **listpri**: Displays prioritized tasks that match terms.
64+
- **listproj**: Lists all projects starting with +.
65+
- **prepend**: Adds text to the beginning of a task.
66+
- **pri**: Adds or updates the priority of a task.
67+
- **replace**: Replaces a task with updated text.
68+
4469
### Warning
4570

4671
The Windows command line uses the `@` sign to indicate that command line arguments should be loaded from

src/todo/TodoApplication.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,12 @@ private async Task AddPriority(int item, char priority)
305305
}
306306
}
307307

308+
private async Task Edit()
309+
{
310+
// TODO: Implement logic to open the folder containing the todo.txt file in VS Code
311+
Console.WriteLine("Opening folder in VS Code...");
312+
}
313+
308314
private RootCommand CreateCommands()
309315
{
310316
var add = new Command("add", "Adds THING I NEED TO DO to your todo.txt file on its own line.");
@@ -369,6 +375,13 @@ private RootCommand CreateCommands()
369375
await Deprioritize(items);
370376
});
371377

378+
var edit = new Command("edit", "Opens the folder containing the todo.txt file in VS Code.");
379+
edit.Handler = CommandHandler.Create(async (string d) =>
380+
{
381+
Configure(d);
382+
await Edit();
383+
});
384+
372385
var @do = new Command("do", "Marks task(s) on line ITEM# as done in todo.txt.");
373386
@do.AddArgument(new Argument<int[]>("items", () => new int[] { }));
374387
@do.Handler = CommandHandler.Create(async (int[] items, bool a, string d) =>
@@ -471,6 +484,7 @@ private RootCommand CreateCommands()
471484
archive,
472485
delete,
473486
depri,
487+
edit,
474488
@do,
475489
list,
476490
listall,

0 commit comments

Comments
 (0)