Skip to content

Commit

Permalink
cmd: Add 'version' option
Browse files Browse the repository at this point in the history
This 'version' option prints the debos version

Signed-off-by: Dylan Aïssi <[email protected]>
  • Loading branch information
daissi committed Oct 30, 2024
1 parent 277e7d3 commit be8306c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/debos/debos.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"github.com/jessevdk/go-flags"
)

const Version = "1.1.4"

func checkError(context *debos.DebosContext, err error, a debos.Action, stage string) int {
if err == nil {
return 0
Expand Down Expand Up @@ -75,6 +77,7 @@ func main() {
PrintRecipe bool `long:"print-recipe" description:"Print final recipe"`
DryRun bool `long:"dry-run" description:"Compose final recipe to build but without any real work started"`
DisableFakeMachine bool `long:"disable-fakemachine" description:"Do not use fakemachine."`
Version bool `long:"version" description:"Print debos version"`
}

// These are the environment variables that will be detected on the
Expand Down Expand Up @@ -110,6 +113,11 @@ func main() {
}
}

if options.Version {
fmt.Printf("debos %s\n", Version)
return
}

if len(args) != 1 {
log.Println("No recipe given!")
exitcode = 1
Expand Down

0 comments on commit be8306c

Please sign in to comment.