Skip to content

Commit

Permalink
feat: alias for import-project
Browse files Browse the repository at this point in the history
  • Loading branch information
nermalcat69 committed Sep 26, 2024
1 parent 72ac242 commit 390d1d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmd/projectImport.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const defaultYamlFilePattern = "*import.yml"

func projectImportCmd() *cmdBuilder.Cmd {
return cmdBuilder.NewCmd().
Use("import").
Use("import-project").
Aliases("import").
Short(i18n.T(i18n.CmdDescProjectImport)).
Long(i18n.T(i18n.CmdDescProjectImportLong)).
StringFlag("orgId", "", i18n.T(i18n.OrgIdFlag)).
Expand Down
1 change: 1 addition & 0 deletions src/cmdBuilder/buildCobraCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func buildCobraCmd(
Short: cmd.short,
SilenceUsage: cmd.silenceUsage,
SilenceErrors: cmd.silenceError,
Aliases: cmd.aliases,
}

if cmd.helpTemplate != "" {
Expand Down
6 changes: 6 additions & 0 deletions src/cmdBuilder/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type ScopeLevel interface {

type Cmd struct {
use string
aliases []string
short string
long string
helpTemplate string
Expand Down Expand Up @@ -60,6 +61,11 @@ func (cmd *Cmd) Use(use string) *Cmd {
return cmd
}

func (cmd *Cmd) Aliases(aliases ...string) *Cmd {
cmd.aliases = aliases
return cmd
}

func (cmd *Cmd) SetHelpTemplate(template string) *Cmd {
cmd.helpTemplate = template
return cmd
Expand Down

0 comments on commit 390d1d0

Please sign in to comment.