MCPcopy Index your code
hub / github.com/docker/docker-agent / readInitialMessage

Function readInitialMessage

cmd/root/run.go:889–904  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

887}
888
889func readInitialMessage(args []string) (*string, error) {
890 if len(args) < 2 {
891 return nil, nil
892 }
893
894 if args[1] == "-" {
895 buf, err := io.ReadAll(os.Stdin)
896 if err != nil {
897 return nil, fmt.Errorf("failed to read from stdin: %w", err)
898 }
899 text := string(buf)
900 return &text, nil
901 }
902
903 return &args[1], nil
904}
905
906// tuiOpts returns the TUI options derived from the current flags. args are
907// the run command's positional arguments, used to detect an initial message.

Callers 2

runLeanTUIMethod · 0.85
buildAppOptsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected