Skip to content

Commit

Permalink
chore: release v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Sep 21, 2022
1 parent 1fde4f7 commit 4387eb2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
30 changes: 13 additions & 17 deletions cmd/grm/helper.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"os"

"github.com/modern-magic/grm/internal"
Expand All @@ -10,20 +9,17 @@ import (
"github.com/modern-magic/grm/internal/registry"
)

var helperInfo = `Usage: Grm [options] [command]
var helperText = `
` + `Running version ` + grmVersion + `.` + `
Options:
-v, --version Output the version number
-h, --help Output usage information
Usage:
Commands:
ls List all the registries
current Show current registry name
use <name> Change registry to registry
test <name> Test response time for specific or all registries
add <name> <registry> [home] Add one custom registry
del <name> Delete one custom registry by alias
help Print this help
grm current : Display active registry name.
grm list : List the registry info. Aliased as ls.
grm test [name] : Test response time for specific or all registries.
grm add <name> <registry> [home] : Add one custom registry.
grm del <name> : Delete one custom registry by alias.
grm version : Displays the current running version of grm. Aliased as v.
`

func Run() int {
Expand All @@ -34,7 +30,7 @@ func runImpl(args []string) int {

if len(args) == 0 {
logger.PrintTextWithColor(os.Stdout, func(c logger.Colors) string {
return fmt.Sprintf("%s%s%s", c.Cyan, helperInfo, c.Reset)
return helperText
})
return 0
}
Expand All @@ -43,11 +39,11 @@ func runImpl(args []string) int {
switch arg {
case "-h", "--help", "help":
logger.PrintTextWithColor(os.Stdout, func(c logger.Colors) string {
return fmt.Sprintf("%s%s%s", c.Cyan, helperInfo, c.Reset)
return helperText
})
return 0
case "-v", "--version", "version":
logger.Info(internal.StringJoin("[Grm]: version", grmVersion))
logger.Success(internal.StringJoin("[Grm]: version", grmVersion))
return 0
}
}
Expand All @@ -66,7 +62,7 @@ func parserSourceForRun(args []string, source registry.Source) int {

for _, arg := range args {
switch arg {
case "ls":
case "ls", "list":
return act.View(action.ViewOptions{All: true})
case "current":
return act.View(action.ViewOptions{All: false})
Expand Down
2 changes: 1 addition & 1 deletion cmd/grm/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const grmVersion = "0.7.0"
const grmVersion = "0.8.0"
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.8.0

0 comments on commit 4387eb2

Please sign in to comment.