2019-02-10 13:04:11 -05:00
|
|
|
package control
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2021-02-16 15:31:50 -05:00
|
|
|
"github.com/v2fly/v2ray-core/v4/common"
|
|
|
|
"github.com/v2fly/v2ray-core/v4/common/uuid"
|
2019-02-10 13:04:11 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type UUIDCommand struct{}
|
|
|
|
|
|
|
|
func (c *UUIDCommand) Name() string {
|
|
|
|
return "uuid"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *UUIDCommand) Description() Description {
|
|
|
|
return Description{
|
|
|
|
Short: "Generate new UUIDs",
|
|
|
|
Usage: []string{"v2ctl uuid"},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *UUIDCommand) Execute([]string) error {
|
|
|
|
u := uuid.New()
|
|
|
|
fmt.Println(u.String())
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
common.Must(RegisterCommand(&UUIDCommand{}))
|
|
|
|
}
|