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

Function NewAliasUnsetCommand

cmd/alias/unset.go:11–28  ·  view source on GitHub ↗

NewAliasUnsetCommand creates and returns the cobra command for unsetting an alias.

()

Source from the content-addressed store, hash-verified

9
10// NewAliasUnsetCommand creates and returns the cobra command for unsetting an alias.
11func NewAliasUnsetCommand() *cobra.Command {
12 cmd := &cobra.Command{
13 Use: "unset <alias>",
14 Args: cobra.ExactArgs(1),
15 Short: "Unset the alias",
16 Long: "Unset the alias",
17 Run: func(_ *cobra.Command, args []string) {
18 aliasContent := args[0]
19 configuration, err := config.LoadConfig()
20 if err != nil {
21 utils.Fatalln(err)
22 }
23 controller := control.NewAliasController("", configuration, aliasContent)
24 controller.UnsetAlias()
25 },
26 }
27 return cmd
28}

Calls 4

UnsetAliasMethod · 0.95
LoadConfigFunction · 0.92
FatallnFunction · 0.92
NewAliasControllerFunction · 0.92