NewAliasListCommand creates and returns the cobra command for listing aliases.
()
| 9 | |
| 10 | // NewAliasListCommand creates and returns the cobra command for listing aliases. |
| 11 | func NewAliasListCommand() *cobra.Command { |
| 12 | cmd := &cobra.Command{ |
| 13 | Use: "list", |
| 14 | Short: "List all alias", |
| 15 | Long: "List all alias", |
| 16 | Aliases: []string{"ls"}, |
| 17 | Run: func(_ *cobra.Command, _ []string) { |
| 18 | configuration, err := config.LoadConfig() |
| 19 | if err != nil { |
| 20 | utils.Fatalln(err) |
| 21 | } |
| 22 | controller := control.NewAliasController("", configuration, "") |
| 23 | controller.ListAlias() |
| 24 | }, |
| 25 | } |
| 26 | return cmd |
| 27 | } |