icommand

package
v0.0.0-...-61d19a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2019 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdConsole = cli.Command{
	Name:        "console",
	Usage:       "Interactive ernest shell",
	ArgsUsage:   "console",
	Description: "Interactive ernest shell",
	Action: func(ctx *cli.Context) error {
		client := command.Esetup(ctx, command.AuthUsersValidation)

		userChain = append(userChain, client.Config())
		h.Console = true
		shell := ishell.New()
		updatePrompt(shell)
		defaults = map[string]string{}

		defer func() {

			if recover() != nil {
				shell.Run()
			}
		}()

		shell.Println(" _____ ____  _      _____ ____  _____")
		shell.Println("/  __//  __\\/ \\  /|/  __// ___\\/__ __\\")
		shell.Println("|  \\  |  \\/|| |\\ |||  \\  |    \\  / \\")
		shell.Println("|  /_ |    /| | \\|||  /_ \\___ |  | |")
		shell.Println("\\____\\\\_/\\_\\\\_/  \\|\\____\\\\____/  \\_/")
		shell.Println("---------------------------------------------------")
		shell.Println("")
		shell.Println("Start by typing help")

		shell.AddCmd(&ishell.Cmd{
			Name: "login",
			Help: "login",
			Func: loginICmd(shell),
		})

		shell.AddCmd(projectICmd(shell, ctx))
		shell.AddCmd(sudoICmd(shell, ctx))
		shell.AddCmd(whoamiICmd(shell, ctx))
		shell.AddCmd(exitICmd(shell, ctx))
		shell.AddCmd(defaultsICmd(shell, ctx))
		shell.AddCmd(envICmd(shell, ctx))
		shell.AddCmd(info(shell, ctx))
		shell.AddCmd(notify(shell, ctx))
		shell.AddCmd(policy(shell, ctx))
		shell.AddCmd(role(shell, ctx))
		shell.AddCmd(schedule(shell, ctx))

		shell.Run()

		return nil
	},
}

CmdConsole : Open docs in the default browser

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL