aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Readme.md3
-rw-r--r--commands/commands.go15
2 files changed, 16 insertions, 2 deletions
diff --git a/Readme.md b/Readme.md
index 6d1b5fd8..faecc61d 100644
--- a/Readme.md
+++ b/Readme.md
@@ -64,6 +64,9 @@ git bug pull [<remote>]
# Push bugs update to a git remote
git bug push [<remote>]
+
+# Launch the web UI
+git bug webui
```
## Internals
diff --git a/commands/commands.go b/commands/commands.go
index 0a3c33ad..1e8e9e19 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"github.com/MichaelMure/git-bug/repository"
+ "sort"
)
var commandsFlagSet = flag.NewFlagSet("commands", flag.ExitOnError)
@@ -18,19 +19,29 @@ func runCommands(repo repository.Repo, args []string) error {
first := true
- for name, cmd := range CommandMap {
+ keys := make([]string, 0, len(CommandMap))
+
+ for key := range CommandMap {
+ keys = append(keys, key)
+ }
+
+ sort.Strings(keys)
+
+ for _, key := range keys {
if !first {
fmt.Println()
}
first = false
+ cmd := CommandMap[key]
+
if *commandsDesc {
fmt.Printf("# %s\n", cmd.Description)
}
// TODO: the root name command ("git bug") should be passed from git-bug.go but well ...
- fmt.Printf("%s %s %s\n", "git bug", name, cmd.Usage)
+ fmt.Printf("%s %s %s\n", "git bug", key, cmd.Usage)
}
return nil