feat: support --version to get the version

What's the best way to embed the version from git?  Is govvv ok?
pull/4/head
Dominique Merle 2 years ago
parent aa30a38fb5
commit bf55f4fd08

@ -35,8 +35,9 @@ import (
var cfgFile string
var rootCmd = &cobra.Command{
Use: "mj FILE",
Short: "Rank Majority Judgment polls",
Use: "mj FILE",
Version: "0.2.0",
Short: "Rank Majority Judgment polls",
Long: `Resolve majority judgment polls from an input CSV.
Say you have the following tally in a CSV file named example.csv:
@ -262,7 +263,7 @@ func init() {
// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolP("sort", "s", false, "Sort proposals by Rank")
rootCmd.Flags().BoolP("sort", "s", false, "sort proposals by Rank")
}
// initConfig reads in config file and ENV variables if set.

@ -1,18 +1,10 @@
/*
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
/**
* This is a standard Cobra CLI app.
* We don't really use subcommands for now, only the Root one.
*
* A good entrypoint is therefore cmd/root.go
*/
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import "github.com/MieuxVoter/majority-judgment-cli/cmd"

Loading…
Cancel
Save