Skip to content

Commit 10e9e54

Browse files
authored
Merge pull request #6 from ngirard/g37w9y-codex/add-taskgit---version-command
Improve version flag
2 parents b02ca8e + da404b7 commit 10e9e54

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ Taskgist requires a Google AI API key to interact with the Gemini LLM.
119119

120120
Once installed and configured, you can use the `taskgist` CLI. Ensure your virtual environment is activated if you're not using `just run` or `uv run`.
121121
122-
**Check the installed version:**
123-
```bash
124-
taskgist --version
125-
```
126-
127122
**Basic usage with a string input:**
128123
```bash
129124
taskgist "Create a new user authentication system with email verification and password reset capabilities"

src/taskgist/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,14 @@ def create_gist(keyword_phrase_obj: KeywordPhrase) -> str:
135135
def main_cli():
136136
"""Command-line interface for taskgist."""
137137
parser = argparse.ArgumentParser(
138+
prog="taskgist",
138139
description="Generates a concise gist from a software engineering task description using BAML.",
139140
formatter_class=argparse.RawTextHelpFormatter,
140141
)
141142
parser.add_argument(
142143
"--version",
143-
action="store_true",
144-
help="Show program's version number and exit",
144+
action="version",
145+
version=f"%(prog)s {__version__}",
145146
)
146147
parser.add_argument(
147148
"task",

tests/test_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import subprocess
2-
import sys
32
import unittest
43

54
import taskgist
@@ -8,7 +7,7 @@
87
class TestVersionCLI(unittest.TestCase):
98
def test_cli_version(self):
109
result = subprocess.run(
11-
[sys.executable, "-m", "taskgist.main", "--version"],
10+
["taskgist", "--version"],
1211
capture_output=True,
1312
text=True,
1413
)

0 commit comments

Comments
 (0)