mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-19 19:28:22 +00:00
aptly version command.
This commit is contained in:
27
cmd_version.go
Normal file
27
cmd_version.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gonuts/commander"
|
||||
"github.com/gonuts/flag"
|
||||
)
|
||||
|
||||
func aptlyVersion(cmd *commander.Command, args []string) error {
|
||||
fmt.Printf("aptly version: %s\n", 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),
|
||||
}
|
||||
}
|
||||
4
main.go
4
main.go
@@ -11,6 +11,9 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// aptly version
|
||||
const Version = "0.1"
|
||||
|
||||
var cmd *commander.Command
|
||||
|
||||
func init() {
|
||||
@@ -26,6 +29,7 @@ take snapshots and publish them back as Debian repositories.`,
|
||||
makeCmdMirror(),
|
||||
makeCmdSnapshot(),
|
||||
makeCmdPublish(),
|
||||
makeCmdVersion(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user