mirror of
https://github.com/moul/sshportal.git
synced 2024-11-10 09:12:49 +08:00
Add 'version' command
This commit is contained in:
parent
2876f9f947
commit
a08c4519cd
2 changed files with 10 additions and 0 deletions
3
main.go
3
main.go
|
@ -15,10 +15,13 @@ import (
|
|||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
var version = "0.0.1"
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = path.Base(os.Args[0])
|
||||
app.Author = "Manfred Touron"
|
||||
app.Version = version
|
||||
app.Email = "https://github.com/moul/sshportal"
|
||||
app.Flags = []cli.Flag{
|
||||
cli.StringFlag{
|
||||
|
|
7
shell.go
7
shell.go
|
@ -323,6 +323,13 @@ GLOBAL OPTIONS:
|
|||
Action: func(c *cli.Context) error { return nil },
|
||||
},
|
||||
},
|
||||
}, {
|
||||
Name: "version",
|
||||
Usage: "Show the SSHPortal version information",
|
||||
Action: func(c *cli.Context) error {
|
||||
fmt.Fprintf(s, "%s\n", version)
|
||||
return nil
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue