mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 02:02:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			36 lines
		
	
	
		
			680 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			680 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package main
 | |
| 
 | |
| import (
 | |
| 	"os"
 | |
| 
 | |
| 	"github.com/hashicorp/vault/command"
 | |
| 	"github.com/mitchellh/cli"
 | |
| )
 | |
| 
 | |
| // Commands is the mapping of all the available Consul commands.
 | |
| var Commands map[string]cli.CommandFactory
 | |
| 
 | |
| func init() {
 | |
| 	ui := &cli.BasicUi{Writer: os.Stdout}
 | |
| 
 | |
| 	Commands = map[string]cli.CommandFactory{
 | |
| 		"version": func() (cli.Command, error) {
 | |
| 			ver := Version
 | |
| 			rel := VersionPrerelease
 | |
| 			if GitDescribe != "" {
 | |
| 				ver = GitDescribe
 | |
| 			}
 | |
| 			if GitDescribe == "" && rel == "" {
 | |
| 				rel = "dev"
 | |
| 			}
 | |
| 
 | |
| 			return &command.VersionCommand{
 | |
| 				Revision:          GitCommit,
 | |
| 				Version:           ver,
 | |
| 				VersionPrerelease: rel,
 | |
| 				Ui:                ui,
 | |
| 			}, nil
 | |
| 		},
 | |
| 	}
 | |
| }
 | 
