File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 66 "log/slog"
77 "os"
88 "sort"
9-
9+
1010 tea "github.com/charmbracelet/bubbletea"
1111 "github.com/charmbracelet/x/term"
1212 "github.com/pubgo/dix"
@@ -49,6 +49,7 @@ func New(params Params) *Command {
4949 },
5050 Commands : params .Cmd ,
5151 Action : func (ctx context.Context , command * cli.Command ) error {
52+ defer recovery .Exit ()
5253 var cfg = params .Cfg
5354 if utils .IsHelp () {
5455 return cli .ShowAppHelp (command )
@@ -103,7 +104,7 @@ func New(params Params) *Command {
103104 }
104105
105106 msg := resp .Choices [0 ].Message .Content
106- fmt . Println ( msg )
107+ slog . Info ( "openai response git message" , "msg" , msg )
107108 var p1 = tea .NewProgram (InitialTextInputModel (msg ))
108109 mm := assert .Must1 (p1 .Run ()).(model2 )
109110 if mm .isExit () {
@@ -128,6 +129,5 @@ type Command struct {
128129
129130func (c * Command ) Run () {
130131 defer recovery .Exit ()
131- sort .Sort (cli .FlagsByName (c .cmd .Flags ))
132132 assert .Exit (c .cmd .Run (utils .Context (), os .Args ))
133133}
Original file line number Diff line number Diff line change @@ -61,10 +61,7 @@ func (m model2) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6161
6262// View is called to draw the textinput step
6363func (m model2 ) View () string {
64- return fmt .Sprintf (
65- "git message: %s\n " ,
66- m .textInput .View (),
67- )
64+ return fmt .Sprintf ("git message: %s\n Please update and type key enter\n " , m .textInput .View ())
6865}
6966
7067func (m model2 ) Value () string {
You can’t perform that action at this time.
0 commit comments