Skip to content

Commit 6e63e5c

Browse files
committed
Add version subcommand
1 parent 3cd3970 commit 6e63e5c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ The interactive UI supports:
7575
- Enter to select
7676
- q or Ctrl+C to quit
7777

78+
### Subcommands
79+
80+
- setup: First-time configuration wizard (writes `~/.tess/config.toml`).
81+
- doctor: Environment and API diagnostics.
82+
- version: Print the current version.
83+
84+
Examples:
85+
86+
```
87+
tess setup
88+
tess doctor
89+
tess version
90+
```
91+
7892
## Flags
7993

8094
- `--config`: Path to config TOML (default: `~/.tess/config.toml`).

cmd/tess.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ func main() {
100100
fmt.Fprintf(out, " tess doctor\n\n")
101101
fmt.Fprintf(out, "Subcommands:\n")
102102
fmt.Fprintf(out, " setup First-time configuration wizard (writes ~/.tess/config.toml)\n")
103-
fmt.Fprintf(out, " doctor Environment and API diagnostics\n\n")
103+
fmt.Fprintf(out, " doctor Environment and API diagnostics\n")
104+
fmt.Fprintf(out, " version Print the current version\n\n")
104105
fmt.Fprintf(out, "Flags:\n")
105106
flag.PrintDefaults()
106107
}
@@ -132,6 +133,9 @@ func main() {
132133
os.Exit(code)
133134
}
134135
return
136+
case "version":
137+
fmt.Println(api.Version)
138+
return
135139
case "help":
136140
flag.Usage()
137141
return

0 commit comments

Comments
 (0)