Skip to content
This repository was archived by the owner on Feb 4, 2026. It is now read-only.

Commit 194382b

Browse files
committed
impr: help - ordered commands
1 parent bed7862 commit 194382b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

cmd/help.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ import (
99

1010
const helpHelp = "usage: sqlpkg help"
1111

12+
var commands = []string{
13+
"install", "uninstall", "update", "list", "init", "info", "help", "version",
14+
}
15+
1216
var commandsHelp = map[string]string{
17+
"help": "Display help",
18+
"info": "Display package information",
1319
"init": "Create a local repository",
1420
"install": "Install a package",
21+
"list": "List installed packages",
1522
"uninstall": "Uninstall a package",
1623
"update": "Update installed packages",
17-
"list": "List installed packages",
18-
"info": "Display package information",
24+
"version": "Display version",
1925
}
2026

2127
// Help prints available commands.
@@ -24,11 +30,11 @@ func Help(args []string) error {
2430
return errors.New(helpHelp)
2531
}
2632

27-
log("`sqlpkg` is an SQLite package manager. Use it to install or update SQLite extensions.")
33+
log("`sqlpkg` is an SQLite package manager. Use it to install or update SQLite extensions.\n")
2834
log("Commands:")
2935
w := tabwriter.NewWriter(os.Stdout, 0, 4, 0, ' ', 0)
30-
for cmd, descr := range commandsHelp {
31-
fmt.Fprintln(w, cmd, "\t", descr)
36+
for _, cmd := range commands {
37+
fmt.Fprintln(w, cmd, "\t", commandsHelp[cmd])
3238
}
3339
w.Flush()
3440

0 commit comments

Comments
 (0)