Skip to content

Commit

Permalink
cmd: add build information
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
  • Loading branch information
katexochen committed Oct 2, 2023
1 parent 5e5f67f commit 191481f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,25 @@ const (
configName = "uplosi.toml"
)

var (
version = "0.0.0-dev"
commit = "HEAD"
)

func newCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "uplosi <provider> <image>",
Short: "uplosi is a tool for uploading images to a cloud provider",
PersistentPreRun: preRunRoot,
RunE: run,
Version: version,
Args: cobra.MatchAll(cobra.ExactArgs(2), isCSP(0)),
}
cmd.SetOut(os.Stdout)
cmd.InitDefaultVersionFlag()
cmd.SetVersionTemplate(
fmt.Sprintf("uplosi - upload OS images\n\nversion %s\ncommit %s\n", version, commit),
)

cmd.Flags().BoolP("increment-version", "i", false, "increment version number in config after upload")

Expand Down

0 comments on commit 191481f

Please sign in to comment.