Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Add version command
Browse files Browse the repository at this point in the history
  • Loading branch information
cam-stitt committed Jan 7, 2018
1 parent 469dd8f commit 9894c7a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions cmd/rise.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ package cmd

import (
"log"
"fmt"

"github.com/openpixel/rise/runner"
"github.com/spf13/cobra"
)

const version = "v0.0.6"

var inputs string
var outputs string
var varFiles []string
Expand All @@ -15,6 +18,7 @@ func init() {
RootCmd.PersistentFlags().StringVarP(&inputs, "input", "i", "", "The file to perform interpolation on")
RootCmd.PersistentFlags().StringVarP(&outputs, "output", "o", "", "The file to output")
RootCmd.PersistentFlags().StringSliceVarP(&varFiles, "vars", "V", []string{}, "The files that contains the variables to be interpolated")
RootCmd.AddCommand(versionCmd)
}

// RootCmd is the root command for the entire cli
Expand All @@ -32,3 +36,11 @@ var RootCmd = &cobra.Command{
}
},
}

var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of rise",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(version)
},
}

0 comments on commit 9894c7a

Please # to comment.