-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: interactive shell command �[?25l�[0;94;49m> �[0;39;49m�[0;39;49…
…m�[0;39;49m�[J�[?12l�[?25h�[2D�[J�[0;94;49m> �[0;39;49m�[0;39;49m �[0;39;49m�[?25l�[0;94;49m> �[0;39;49m�[0;39;49m�[0;39;49m�[J�D�D�D�D�D�D�M�M�M�M�M�M�[0;97;46m�[1B�[0;97;46m applicationloadbalancer �[0;30;106m Application Load Balancer Operations �[0;39;100m �[0;39;49m �[1A�[2C�[1B�[0;97;46m backupunit �[0;30;106m BackupUnit Operations �[0;39;100m �[0;39;49m �[1A�[2C�[1B�[0;97;46m certificate-manager �[0;30;106m Certificate Manager Operations �[0;39;46m �[0;39;49m �[1A�[2C�[1B�[0;97;46m completion �[0;30;106m Generate the autocompletion script for the specified shell �[0;39;46m �[0;39;49m �[1A�[2C�[1B�[0;97;46m container-registry �[0;30;106m Registry Operations �[0;39;46m �[0;39;49m �[1A�[2C�[1B�[0;97;46m contract �[0;30;106m Contract Resources Operations �[0;39;46m �[0;39;49m �[1A�[2C�[6A�[0;39;49m�[?12l�[?25h�[2D�[J�[0;94;49m> �[0;39;49m�[0;39;49m �[0;39;49m�]2;��[J
- Loading branch information
1 parent
b598490
commit afee029
Showing
69 changed files
with
5,595 additions
and
8 deletions.
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
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,37 @@ | ||
package commands | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"github.com/ionos-cloud/ionosctl/v6/pkg/constants" | ||
"github.com/ionos-cloud/ionosctl/v6/pkg/core" | ||
"github.com/stromland/cobra-prompt" | ||
) | ||
|
||
var simplePrompt = &cobraprompt.CobraPrompt{ | ||
RootCmd: GetRootCmd().Command, | ||
AddDefaultExitCommand: true, | ||
DisableCompletionCommand: true, | ||
OnErrorFunc: func(err error) { | ||
fmt.Printf(err.Error()) | ||
}, | ||
} | ||
|
||
func InteractiveShellCmd() *core.Command { | ||
versionCmd := core.NewCommand(context.Background(), nil, core.CommandBuilder{ | ||
Namespace: "shell", | ||
Resource: "shell", | ||
Verb: "shell", | ||
ShortDesc: "Use ionosctl interactively", | ||
Example: "ionosctl shell", | ||
PreCmdRun: core.NoPreRun, | ||
CmdRun: func(commandConfig *core.CommandConfig) error { | ||
simplePrompt.Run() | ||
return nil | ||
}, | ||
InitClient: false, | ||
}) | ||
versionCmd.AddBoolFlag(constants.ArgUpdates, "", false, "Check for latest updates for CLI") | ||
|
||
return versionCmd | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.