Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: Add 'version' option #517

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 v%s\n", Version)
return
}

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