mirror of https://github.com/restic/restic.git
Add 'version' command
This commit is contained in:
parent
9c742c7b4b
commit
bcb19c811b
|
@ -0,0 +1,32 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/restic/restic"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CmdVersion struct{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
_, err := parser.AddCommand("version",
|
||||||
|
"display version",
|
||||||
|
"The version command displays detailed information about the version",
|
||||||
|
&CmdVersion{})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cmd CmdVersion) Execute(args []string) error {
|
||||||
|
fmt.Printf("restic version %s, lib %v on %v\n", version, restic.Version, runtime.Version())
|
||||||
|
for _, s := range features {
|
||||||
|
fmt.Printf(" %s\n", s)
|
||||||
|
}
|
||||||
|
for _, s := range restic.Features {
|
||||||
|
fmt.Printf(" %s\n", s)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
package restic
|
||||||
|
|
||||||
|
var Version = "compiled manually"
|
||||||
|
var Features = []string{}
|
Loading…
Reference in New Issue