(args []string)
| 887 | } |
| 888 | |
| 889 | func 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. |
no outgoing calls
no test coverage detected