// getShell is a helper function which gets the right shell for prefixing the
// shell-form of RUN, ENTRYPOINT and CMD instructions
333593
func getShell(c *container.Config, os string) []string {
	if 0 == len(c.Shell) {
		return append([]string{}, defaultShellForOS(os)[:]...)
	}
	return append([]string{}, c.Shell[:]...)
}
760476
func (t *TermHandlers) HandleShell(ch ssh.Channel, req *ssh.Request, ctx *ServerContext) error {
	var err error

	// creating an empty exec request implies a interactive shell was requested
	ctx.ExecRequest, err = NewExecRequest(ctx, "")
	if err != nil {
		return trace.Wrap(err)
	}

	if err := t.SessionRegistry.OpenSession(ch, req, ctx); err != nil {
		return trace.Wrap(err)
	}

	return nil
}
341270
func (vm *VM) GetSSH(options ssh.Options) (ssh.Client, error) {

	ips, err := util.GetVMIPs(vm, options)
	if err != nil {
		return nil, err
	}

	client := &ssh.SSHClient{
		Creds:   &vm.SSHCreds,
		IP:      ips[0], // public IP
		Options: options,
		Port:    22,
	}
	if err := client.WaitForSSH(SSHTimeout); err != nil {
		return nil, err
	}

	return client, nil

}
506429
func (c *FakeDeployments) Get(name string, options v1.GetOptions) (result *appsv1.Deployment, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &appsv1.Deployment{})

	if obj == nil {
		return nil, err
	}
	return obj.(*appsv1.Deployment), err
}
13212
func NewGetHello(ctx *middleware.Context, handler GetHelloHandler) *GetHello {
	return &GetHello{Context: ctx, Handler: handler}
}
1074380
func GetLoginShell(username string) (string, error) {
	var err error
	var shellcmd string

	shellcmd, err = getLoginShell(username)
	if err != nil {
		if !trace.IsNotFound(err) {
			logrus.Warnf("No shell specified for %v, using default %v.", username, DefaultShell)
			return DefaultShell, nil
		}
		return "", trace.Wrap(err)
	}

	return shellcmd, nil
}
1137800
func resolveCmdLine(cmd instructions.ShellDependantCmdLine, runConfig *container.Config, os, _, _ string) ([]string, bool) {
	result := cmd.CmdLine
	if cmd.PrependShell && result != nil {
		result = append(getShell(runConfig, os), result...)
	}
	return result, false
}
1264020
func GetCommand() *Command {
	var command *Command
loop:
	for {
		cmd := prompter.Choose("\nEnter command", []string{"quit", "message"}, "message")
		command = new(Command)
		switch cmd {
		case "quit":
			command.Cmd = "quit"
			fin := prompter.YN("Quit?", true)
			if fin {
				break loop
			}
		case "message":
			command.Cmd = "message"
			var (
				topic string
				text  string
			)
			for {
				topic = prompter.Prompt("Enter topic (REQUIRED)", "")
				if topic == "" {
					fmt.Println("topic cannot be blank")
				} else {
					break
				}
			}
			for {
				text = prompter.Prompt("Enter message (REQUIRED)", "")
				if text == "" {
					fmt.Println("message cannot be blank")
				} else {
					break
				}
			}
			command.Topic = topic
			command.Text = text
			key := prompter.Prompt("Enter key", "")
			command.Key = key
			metadata := prompter.Prompt("Enter metadata", "")
			command.Metadata = metadata
			send := prompter.YN("Send Message?", true)
			if send {
				break loop
			}
		}
	}
	return command
}
859552
func (o *RuntimeOpt) GetMap() map[string]types.Runtime {
	if o.values != nil {
		return *o.values
	}

	return map[string]types.Runtime{}
}
396265
func (v *ListTypeVersioningV2) GetHello() (o string) {
	if v != nil && v.Hello != nil {
		return *v.Hello
	}

	return
}
171747
func Geted() string {
	if dir, err := filepath.Abs(filepath.Dir(os.Args[0])); err == nil {
		return dir
	} else {
		panic("Failed to retrieve executable directory")
	}
}
336113
func getOSesCmd(params *Parameters) *subcommands.Command {
	return &subcommands.Command{
		UsageLine: "get-oses [-name <name>]...",
		ShortDesc: "retrieves operating systems",
		LongDesc:  "Retrieves operating systems matching the given names, or all operating systems if names are omitted.\n\nExample to get all OSes:\ncrimson get-oses\nExample to get Mac 10.13.3:\ncrimson get-oses -name 'Mac 10.13.3 (Darwin 17.4.0)'",
		CommandRun: func() subcommands.CommandRun {
			cmd := &GetOSesCmd{}
			cmd.Initialize(params)
			cmd.Flags.Var(flag.StringSlice(&cmd.req.Names), "name", "Name of an operating system to filter by. Can be specified multiple times.")
			return cmd
		},
	}
}
775932
func GetCmdPath(cmd string) (string, error) {
	if filepath.IsAbs(cmd) {
		return cmd, nil
	}
	return exec.LookPath(cmd)
}
338261
func (j *Js) Getpath(args ...string) *Js {
	d := j
	for i := range args {
		m := d.Getdata()

		if val, ok := m[args[i]]; ok {
			d.data = val
		} else {
			d.data = nil
			return d
		}
	}
	return d
}
866621
func NewGetBlockCmd(hash string, verbose, verboseTx *bool) *GetBlockCmd {
	return &GetBlockCmd{
		Hash:      hash,
		Verbose:   verbose,
		VerboseTx: verboseTx,
	}
}
325793
func (e *Echo) Get(path string, h interface{}, m ...interface{}) {
	e.add(GET, "", path, h, m...)
}
806298
func Getwd() string {
	if cwd, err := os.Getwd(); err == nil {
		cwd, _ = filepath.Abs(cwd)
		return cwd
	} else {
		panic("Failed to retrieve current working directory")
	}
}