Skip to content

Commit

Permalink
updated help and cli to make more accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanisham committed Jun 21, 2024
1 parent 5c83932 commit 78cf41e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,21 @@ vmu mach # Sets ZVM to pull from Mach nominated Zig.
```sh
zvm help
```
Or use it to dive deeper into a specific command.
```sh
zvm help list
```
```
NAME:
zvm list - list installed Zig versions. Flag `--all` to see remote options
USAGE:
zvm list [command options] [arguments...]
OPTIONS:
--all, -a list remote Zig versions available for download, based on your version map (default: false)
--help, -h show help
```

## Print program version

Expand Down
2 changes: 1 addition & 1 deletion cli/meta/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

const (
VERSION = "v0.7.1"
VERSION = "v0.7.2"
// VERSION = "v0.0.0" // For testing zvm upgrade

)
Expand Down
25 changes: 21 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,25 +130,42 @@ var zvmApp = &opts.App{
},
{
Name: "list",
Usage: "list installed Zig versions",
Usage: "list installed Zig versions. Flag `--all` to see remote options",
Aliases: []string{"ls"},
Args: true,
Flags: []opts.Flag{
&opts.BoolFlag{
Name: "all",
Aliases: []string{"a"},
Usage: "list remote Zig versions available for download",
Usage: "list remote Zig versions available for download, based on your version map",
},
},
Action: func(ctx *opts.Context) error {
log.Debug("Version Map", "url", zvm.Settings.VersionMapUrl)
log.Debug("Version Map", "url", zvm.Settings.VersionMapUrl, "cmd", "list/ls")
if ctx.Bool("all") {
return zvm.ListRemoteAvailable()
} else {
return zvm.ListVersions()
}
},
},
// {
// Name: "list:all",
// Usage: "list remote Zig versions available for download, based on your version map",
// Aliases: []string{"la"},
// Args: false,
// // Flags: []opts.Flag{
// // &opts.BoolFlag{
// // Name: "all",
// // Aliases: []string{"a"},
// // Usage: "list remote Zig versions available for download",
// // },
// // },
// Action: func(ctx *opts.Context) error {
// log.Debug("Version Map", "url", zvm.Settings.VersionMapUrl, "cmd", "la")
// return zvm.ListRemoteAvailable()
// },
// },
{
Name: "uninstall",
Usage: "remove an installed version of Zig",
Expand Down Expand Up @@ -212,7 +229,7 @@ func main() {
_, checkUpgradeDisabled := os.LookupEnv("ZVM_SET_CU")
log.Debug("Automatic Upgrade Checker", "disabled", checkUpgradeDisabled)

// Upgrade
// Upgrade
upSig := make(chan string, 1)

if !checkUpgradeDisabled {
Expand Down

0 comments on commit 78cf41e

Please sign in to comment.