From 78cf41eb3fc7068029b135f627de65fc27ebfb1c Mon Sep 17 00:00:00 2001 From: Tristan Isham Date: Fri, 21 Jun 2024 02:00:29 -0400 Subject: [PATCH] updated help and cli to make more accessible --- README.md | 15 +++++++++++++++ cli/meta/version.go | 2 +- main.go | 25 +++++++++++++++++++++---- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1e04183..3514f13 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cli/meta/version.go b/cli/meta/version.go index da2c3d6..2a19b1d 100644 --- a/cli/meta/version.go +++ b/cli/meta/version.go @@ -9,7 +9,7 @@ import ( ) const ( - VERSION = "v0.7.1" + VERSION = "v0.7.2" // VERSION = "v0.0.0" // For testing zvm upgrade ) diff --git a/main.go b/main.go index b06ae8f..6861c8b 100644 --- a/main.go +++ b/main.go @@ -130,18 +130,18 @@ 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 { @@ -149,6 +149,23 @@ var zvmApp = &opts.App{ } }, }, + // { + // 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", @@ -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 {