-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Junjie Gao <[email protected]>
- Loading branch information
Showing
6 changed files
with
55 additions
and
11 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
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
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
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
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,32 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
|
||
"github.com/notaryproject/notation/internal/version" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func versionCommand() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "version", | ||
Short: "Show the notation version information", | ||
Args: cobra.NoArgs, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
runVersion() | ||
}, | ||
} | ||
return cmd | ||
} | ||
|
||
func runVersion() { | ||
fmt.Printf("Notation: Notary v2, A tool to sign, store, and verify artifacts.\n\n") | ||
|
||
fmt.Printf("Version: %s\n", version.GetVersion()) | ||
fmt.Printf("Go version: %s\n", runtime.Version()) | ||
|
||
if version.GitCommit != "" { | ||
fmt.Printf("Git commit: %s\n", version.GitCommit) | ||
} | ||
} |
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