-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rerost
committed
Jun 22, 2019
1 parent
3ad79ce
commit ae3a0f5
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package alias | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/rerost/es-cli/domain" | ||
"github.com/spf13/cobra" | ||
"github.com/srvc/fail" | ||
) | ||
|
||
func NewAliasCommand(ctx context.Context, alis domain.Alias) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "alias", | ||
Short: "unlink alias", | ||
Args: cobra.MinimumNArgs(2), | ||
RunE: func(_ *cobra.Command, args []string) error { | ||
err := alis.Remove(ctx, args[0], args[1:]...) | ||
return fail.Wrap(err) | ||
}, | ||
} | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package remove | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/rerost/es-cli/cmd/remove/alias" | ||
"github.com/rerost/es-cli/domain" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewRemoveCommand(ctx context.Context, alis domain.Alias) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "remove", | ||
Short: "Remove elasitcsearch resources", | ||
Args: cobra.ExactArgs(1), | ||
} | ||
|
||
cmd.AddCommand(alias.NewAliasCommand(ctx, alis)) | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters