forked from ribice/glice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
glice version
command with version=="3.0.0-alpha"
- Loading branch information
Mike Schinkel
committed
Oct 21, 2022
1 parent
ace8078
commit fd9ef10
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cmd | ||
|
||
import ( | ||
glice "github.com/ribice/glice/v3/pkg" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// versionCmd represents the version command | ||
var versionCmd = &cobra.Command{ | ||
Use: "version", | ||
Run: glice.RunVersion, | ||
Short: "Display the current version of Glice", | ||
Long: `Display the current version of Glice in 'v{Major}.{Minor}.{Patch}[-{Prerelease}" format.`, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(versionCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
package glice | ||
|
||
const AppName = "Glice" | ||
const AppVersion = "3.0.0-alpha" | ||
|
||
const LicenseListSourceURL = "https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package glice | ||
|
||
import ( | ||
"fmt" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func RunVersion(cmd *cobra.Command, args []string) { | ||
fmt.Printf("%s v%s\n", AppName, AppVersion) | ||
} |