@@ -95,24 +95,26 @@ func main() {
9595 return
9696 }
9797
98- runfilePath , err := locateRunfile (c )
99- if err != nil {
100- slog .Error ("locating runfile" , "err" , err )
101- panic (err )
102- }
98+ // runfilePath, err := locateRunfile(c)
99+ // if err != nil {
100+ // slog.Error("locating runfile", "err", err)
101+ // panic(err)
102+ // }
103103
104- generateShellCompletion (ctx , c .Root ().Writer , runfilePath )
104+ // generateShellCompletion(ctx, c.Root().Writer, runfilePath)
105105 },
106106
107107 Commands : []* cli.Command {
108108 {
109- Name : "shell:completion" ,
110- Usage : "<bash|zsh|fish|ps> " ,
111- Suggest : true ,
109+ Name : "shell:completion" ,
110+ Usage : "[shell] " ,
111+ EnableShellCompletion : false ,
112112 Action : func (ctx context.Context , c * cli.Command ) error {
113- fmt .Printf ("args: (%d)\n " , c .NArg ())
114- if c .NArg () != 1 {
115- return fmt .Errorf ("needs argument one of [bash,zsh,fish,ps]" )
113+ if c .NArg () == 0 {
114+ for _ , shell := range []string {"fish" , "bash" , "zsh" , "powershell" } {
115+ fmt .Fprintf (c .Writer , "%s\n " , shell )
116+ }
117+ return nil
116118 }
117119
118120 switch c .Args ().First () {
@@ -139,12 +141,12 @@ func main() {
139141
140142 showList := c .Bool ("list" )
141143 if showList {
142- runfilePath , err := locateRunfile (c )
143- if err != nil {
144- slog .Error ("locating runfile, got" , "err" , err )
145- return err
146- }
147- return generateShellCompletion (ctx , c .Root ().Writer , runfilePath )
144+ // runfilePath, err := locateRunfile(c)
145+ // if err != nil {
146+ // slog.Error("locating runfile, got", "err", err)
147+ // return err
148+ // }
149+ // return generateShellCompletion(ctx, c.Root().Writer, runfilePath)
148150 }
149151
150152 if c .NArg () == 0 {
@@ -185,37 +187,20 @@ func main() {
185187 return fmt .Errorf ("parallel and watch can't be set together" )
186188 }
187189
188- logger := fastlog .New (fastlog.Options {
189- Format : fastlog .ConsoleFormat ,
190- EnableColors : true ,
191- ShowCaller : debug ,
192- ShowTimestamp : false ,
193- ShowDebugLogs : debug ,
194- })
190+ logger := fastlog .New (fastlog .Console (), fastlog .ShowDebugLogs (debug ), fastlog .WithoutTimestamp ())
195191
196192 runfilePath , err := locateRunfile (c )
197193 if err != nil {
198194 slog .Error ("locating runfile, got" , "err" , err )
199195 return err
200196 }
201197
202- rctx := runfile .NewContext (ctx , logger )
203-
204- rf , err := runfile .ParseFromFile (rctx , runfilePath )
205- if err != nil {
206- slog .Error ("parsing runfile, got" , "err" , err )
207- panic (err )
208- }
209-
210- if err := rf .Run (rctx , args , runfile.RunOption {
211- ExecuteInParallel : parallel ,
212- Watch : watch ,
213- Debug : debug ,
214- KVs : kv ,
215- }); err != nil {
198+ if err := runfile .RunTask (ctx , runfilePath , args [0 ]); err != nil {
199+ logger .Error ("ERRORED" , "err" , err )
216200 if err2 , ok := err .(* errors.Error ); ok {
217201 logger .Error (err2 .Error (), err2 .SlogAttrs ()... )
218202 }
203+ return err
219204 }
220205
221206 return nil
0 commit comments