Skip to content

Commit

Permalink
Merge pull request #70 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 4.6.0
  • Loading branch information
andyone authored Mar 26, 2021
2 parents cc54cf0 + 79c3620 commit 73775d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
// Application info
const (
APP = "bibop"
VER = "4.5.0"
VER = "4.6.0"
DESC = "Utility for testing command-line tools"
)

Expand Down Expand Up @@ -344,11 +344,11 @@ func genCompletion() int {

switch options.GetS(OPT_COMPLETION) {
case "bash":
fmt.Printf(bash.Generate(info, "bibop"))
fmt.Printf(bash.Generate(info, "bibop", "recipe"))
case "fish":
fmt.Printf(fish.Generate(info, "bibop"))
case "zsh":
fmt.Printf(zsh.Generate(info, optMap, "bibop"))
fmt.Printf(zsh.Generate(info, optMap, "bibop", "*.recipe"))
default:
return 1
}
Expand Down
4 changes: 4 additions & 0 deletions recipe/recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ func (r *Recipe) AddCommand(cmd *Command, tag string) {
}
}

if isVariable(cmd.Description) {
cmd.Description = renderVars(r, cmd.Description)
}

r.Commands = append(r.Commands, cmd)
}

Expand Down
3 changes: 2 additions & 1 deletion recipe/recipe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ func (s *RecipeSuite) TestBasicRecipe(c *C) {
r.AddVariable("user", "nginx")

c1 := NewCommand([]string{"{user}:echo {service}"}, 0)
c2 := NewCommand([]string{"echo ABCD 1.53 4000", "Echo command"}, 0)
c2 := NewCommand([]string{"echo ABCD 1.53 4000", "Echo command for service {service}"}, 0)

r.AddCommand(c1, "")
r.AddCommand(c2, "special")

c.Assert(r.RequireRoot, Equals, true)
c.Assert(c1.User, Equals, "nginx")
c.Assert(c2.Tag, Equals, "special")
c.Assert(c2.Description, Equals, "Echo command for service nginx")

a1 := &Action{"copy", []string{"file1", "file2"}, true, 0, nil}
a2 := &Action{"touch", []string{"{service}"}, false, 0, nil}
Expand Down

0 comments on commit 73775d3

Please sign in to comment.