mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-20 19:38:39 +00:00
Refactor commands to subpackage.
This commit is contained in:
28
cmd/version.go
Normal file
28
cmd/version.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gonuts/commander"
|
||||
"github.com/gonuts/flag"
|
||||
"github.com/smira/aptly/aptly"
|
||||
)
|
||||
|
||||
func aptlyVersion(cmd *commander.Command, args []string) error {
|
||||
fmt.Printf("aptly version: %s\n", aptly.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
func makeCmdVersion() *commander.Command {
|
||||
return &commander.Command{
|
||||
Run: aptlyVersion,
|
||||
UsageLine: "version",
|
||||
Short: "display version",
|
||||
Long: `
|
||||
Shows aptly version.
|
||||
|
||||
ex:
|
||||
$ aptly version
|
||||
`,
|
||||
Flag: *flag.NewFlagSet("aptly-version", flag.ExitOnError),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user