MCPcopy Create free account
hub / github.com/Driver-C/tryssh / NewKeysCommand

Function NewKeysCommand

cmd/create/keys.go:11–29  ·  view source on GitHub ↗

NewKeysCommand creates and returns the cobra command for creating a key file path entry.

()

Source from the content-addressed store, hash-verified

9
10// NewKeysCommand creates and returns the cobra command for creating a key file path entry.
11func NewKeysCommand() *cobra.Command {
12 cmd := &cobra.Command{
13 Use: "keys <keyFilePath>",
14 Args: cobra.ExactArgs(1),
15 Short: "Create an alternative key file path",
16 Long: "Create an alternative key file path",
17 Aliases: []string{"key"},
18 Run: func(_ *cobra.Command, args []string) {
19 keyPath := args[0]
20 configuration, err := config.LoadConfig()
21 if err != nil {
22 utils.Fatalln(err)
23 }
24 controller := control.NewCreateController(control.TypeKeys, keyPath, configuration)
25 controller.ExecuteCreate()
26 },
27 }
28 return cmd
29}

Calls 4

ExecuteCreateMethod · 0.95
LoadConfigFunction · 0.92
FatallnFunction · 0.92
NewCreateControllerFunction · 0.92