Skip to content

Commit

Permalink
updated help text
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanisham committed Mar 2, 2023
1 parent 531ffc8 commit b8b2689
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 25 deletions.
28 changes: 28 additions & 0 deletions help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
zvm (Zig Version Manager) v0.1.6
--------------------------------

install, i <version>
Use `install` or `i` to download a specific version of Zig.
To install the latest version, use "master"

use <version>
Use `use` to switch between versions of Zig.

ls
Use `ls` to list all installed version of Zig.
uninstall, rm <version>
Use `uninstall` or `rm` to remove an uninstalled version from your system

clean
Use `clean` to remove build artifacts (Good if you're on Windows).

version, --version, -v
Prints the version of ZVM you have installed

help, --help, -h
Prints this message

--nocolor, --nocolour | Turns off color
--color, --colour | Toggles color

--yescolor, --yescolour | Turns on color
32 changes: 7 additions & 25 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import (
"zvm/cli"

"github.com/tristanisham/clr"
_ "embed"
)

//go:embed help.txt
var helpTxt string

func main() {
zvm := cli.Initialize()
args := os.Args[1:]
Expand Down Expand Up @@ -56,33 +60,11 @@ func main() {
}
}
case "version", "--version", "-v":
fmt.Println("zvm v0.1.5")
fmt.Println("zvm v0.1.6")
return
case "help", "--help", "-h":
var help string
if zvm.Settings.UseColor {
help += clr.Blue("Install\n\t")
help += clr.White("zvm i/install ") + clr.Green("<zig version>\n")
help += clr.Blue("Use\n\t")
help += clr.White("zmv use ") + clr.Green("<zig version>\n")
help += clr.Blue("Version\n\t")
help += clr.White("version\n")
help += clr.Blue("Help\n\t")
help += clr.White("help\n")
fmt.Println(help)
return
} else {
help += "Install\n\t"
help += "zvm i/install <zig version>\n"
help += "Use\n\t"
help += "zmv use <zig version>\n"
help += "Version\n\t"
help += "version\n"
help += "Help\n\t"
help += "help\n"
fmt.Println(help)
return
}
//zvm.Settings.UseColor
fmt.Println(helpTxt)
// Settings
case "--nocolor", "--nocolour":
zvm.Settings.NoColor()
Expand Down

0 comments on commit b8b2689

Please sign in to comment.