mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
39 lines
733 B
Go
39 lines
733 B
Go
package version
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
|
|
"github.com/p4gefau1t/trojan-go/common"
|
|
)
|
|
|
|
type versionOption struct {
|
|
arg *bool
|
|
common.OptionHandler
|
|
}
|
|
|
|
func (*versionOption) Name() string {
|
|
return "help"
|
|
}
|
|
|
|
func (*versionOption) Priority() int {
|
|
return 10
|
|
}
|
|
|
|
func (c *versionOption) Handle() error {
|
|
if *c.arg {
|
|
fmt.Println("Trojan-Go", common.Version)
|
|
fmt.Println("Developed by PageFault(p4gefau1t)")
|
|
fmt.Println("Lisensed under GNU General Public License v3")
|
|
fmt.Println("GitHub Repository: https://github.com/p4gefau1t/trojan-go")
|
|
return nil
|
|
}
|
|
return common.NewError("not set")
|
|
}
|
|
|
|
func init() {
|
|
common.RegisterOptionHandler(&versionOption{
|
|
arg: flag.Bool("version", false, "Display version and help info"),
|
|
})
|
|
}
|