Skip to content

Commit 80c71f2

Browse files
committed
Enhance README and CLI: add help command, improve instructions, and update version to 1.0.7
1 parent 1742bcb commit 80c71f2

File tree

4 files changed

+46
-40
lines changed

4 files changed

+46
-40
lines changed

README.md

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,17 @@ A terminal to-do app that helps you focus on one task at a time.
55
[![PyPI version](https://img.shields.io/pypi/v/tasknow.svg)](https://pypi.org/project/tasknow/)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77

8-
---
9-
108
## Why use TaskNow?
119

12-
- **Stay focused:** See just your current task by default
13-
- **Minimalist & distraction-free:** No accounts, no clutter — just your tasks
14-
- **Full control:** Add, complete, edit, and manage tasks easily from the terminal
15-
- **Simple commands:** Intuitive CLI interface
16-
- **Lightweight:** Python-based with JSON storage, works seamlessly on Linux
17-
18-
---
10+
- Stay focused by seeing just your current task
11+
- Add, complete, and manage tasks easily from the terminal
12+
- No accounts, no clutter — just your tasks
1913

2014
## Requirements
2115

2216
- **Python 3.10 or higher**
2317
- Compatible with Ubuntu/Linux systems
2418

25-
---
26-
2719
## Installation
2820

2921
Install TaskNow directly from PyPI:
@@ -32,9 +24,7 @@ Install TaskNow directly from PyPI:
3224
pip install tasknow
3325
```
3426

35-
---
36-
37-
## Quick Start
27+
## Commands
3828

3929
Add a task:
4030

@@ -57,13 +47,13 @@ tasknow done
5747
List all tasks:
5848

5949
```bash
60-
tasknow list
50+
tasknow list # Also shows each task id
6151
```
6252

6353
Remove a task:
6454

6555
```bash
66-
tasknow remove 3
56+
tasknow remove 2 # Remove task with id: 2
6757
```
6858

6959
Show completed tasks:
@@ -75,37 +65,27 @@ tasknow completed
7565
Un-complete a task:
7666

7767
```bash
78-
tasknow undone 3
68+
tasknow undone 3 # Un-complete task with id: 3
7969
```
8070

8171
Edit a task:
8272

8373
```bash
84-
tasknow edit 2 "New task description"
74+
tasknow edit 4 "New task description" # Edit task with id: 4
8575
```
8676

87-
---
88-
89-
For more commands and details, see the full documentation or run:
77+
Show help:
9078

9179
```bash
92-
tasknow --help
80+
tasknow help
9381
```
9482

95-
---
96-
9783
## Links
9884

9985
- **PyPI:** [https://pypi.org/project/tasknow/](https://pypi.org/project/tasknow/)
10086
- **Source Code:** [https://github.com/decodingchris/tasknow](https://github.com/decodingchris/tasknow)
10187
- **Issue Tracker:** [https://github.com/decodingchris/tasknow/issues](https://github.com/decodingchris/tasknow/issues)
10288

103-
---
104-
10589
## License
10690

10791
This project is licensed under the **MIT License**. See the [LICENSE](https://opensource.org/licenses/MIT) file for details.
108-
109-
---
110-
111-
MIT License © Decoding Chris

main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ def main() -> None:
156156
epilog='If no command is provided, defaults to showing the current task.'
157157
)
158158
subparsers = parser.add_subparsers(dest='command')
159+
160+
# Help command
161+
subparsers.add_parser('help', help='Show help message')
159162

160163
# Show current task
161164
subparsers.add_parser('show', help='Show current task')
@@ -233,6 +236,8 @@ def main() -> None:
233236
manager.remove_task(args.id)
234237
print(f"Removed task {args.id}")
235238

239+
elif args.command == 'help':
240+
parser.print_help()
236241
elif args.command == 'undone':
237242
manager.reopen_task(args.id)
238243
print(f"Marked task {args.id} as undone")

setup.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="tasknow",
5-
version="1.0.6",
5+
version="1.0.7",
66
description="A terminal to-do app that helps you focus on one task at a time.",
77
long_description="""# TaskNow
88
@@ -14,9 +14,14 @@
1414
- Add, complete, and manage tasks easily from the terminal
1515
- No accounts, no clutter — just your tasks
1616
17+
## Requirements
18+
19+
- **Python 3.10 or higher**
20+
- Compatible with Ubuntu/Linux systems
21+
1722
## Installation
1823
19-
You can install TaskNow directly from PyPI:
24+
Install TaskNow directly from PyPI:
2025
2126
```bash
2227
pip install tasknow
@@ -36,17 +41,17 @@
3641
3742
Mark it done:
3843
```bash
39-
tasknow done
44+
tasknow done
4045
```
4146
4247
List all tasks:
4348
```bash
44-
tasknow list
49+
tasknow list # Also shows each task id
4550
```
4651
4752
Remove a task:
4853
```bash
49-
tasknow remove <id>
54+
tasknow remove 2 # Remove task with id: 2
5055
```
5156
5257
Show completed tasks:
@@ -56,17 +61,19 @@
5661
5762
Un-complete a task:
5863
```bash
59-
tasknow undone <id>
64+
tasknow undone 3 # Un-complete task with id: 3
6065
```
6166
6267
Edit a task:
6368
```bash
64-
tasknow edit <id> "New description"
69+
tasknow edit 4 "New description" # Edit task with id: 4
6570
```
6671
67-
---
72+
Show help:
6873
69-
MIT License
74+
```bash
75+
tasknow help
76+
```
7077
""",
7178
long_description_content_type="text/markdown",
7279
author="Decoding Chris",

test_main.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,4 +369,18 @@ def test_cli_default_to_show(capsys, tmp_path):
369369
cli_main()
370370

371371
captured = capsys.readouterr()
372-
assert "Current task: Default show task" in captured.out
372+
assert "Current task: Default show task" in captured.out
373+
374+
375+
def test_cli_help_command(capsys):
376+
"""Test the help command prints help message."""
377+
from main import main as cli_main
378+
379+
# Simulate running 'tasknow help'
380+
with patch('sys.argv', ['main.py', 'help']):
381+
cli_main()
382+
383+
captured = capsys.readouterr()
384+
assert "usage: main.py" in captured.out
385+
assert "Show current task" in captured.out
386+
assert "help" in captured.out

0 commit comments

Comments
 (0)