@@ -40,7 +40,7 @@ func RegisterExecCmd(ctx *context.Context, rootCmd *cobra.Command) {
4040 io .TypesDocsURL ("flowfile" , "ExecutableRef" ),
4141 execExamples ,
4242 ),
43- Args : cobra .MinimumNArgs ( 1 ) ,
43+ Args : cobra .ArbitraryArgs ,
4444 ValidArgsFunction : func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
4545 execList , err := ctx .ExecutableCache .GetExecutableList (ctx .Logger )
4646 if err != nil {
@@ -82,8 +82,14 @@ func execFunc(ctx *context.Context, cmd *cobra.Command, verb executable.Verb, ar
8282 logger .FatalErr (err )
8383 }
8484
85- idArg := args [0 ]
86- ref := context .ExpandRef (ctx , executable .NewRef (idArg , verb ))
85+ var ref executable.Ref
86+ if len (args ) == 0 {
87+ ref = context .ExpandRef (ctx , executable .NewRef ("" , verb ))
88+ } else {
89+ idArg := args [0 ]
90+ ref = context .ExpandRef (ctx , executable .NewRef (idArg , verb ))
91+ }
92+
8793 e , err := ctx .ExecutableCache .GetExecutableByRef (logger , ref )
8894 if err != nil && errors .Is (cache .NewExecutableNotFoundError (ref .String ()), err ) {
8995 logger .Debugf ("Executable %s not found in cache, syncing cache" , ref )
@@ -108,12 +114,15 @@ func execFunc(ctx *context.Context, cmd *cobra.Command, verb executable.Verb, ar
108114 ))
109115 }
110116
111- execArgs := args [1 :]
117+ execArgs := make ([]string , 0 )
118+ if len (args ) >= 2 {
119+ execArgs = args [1 :]
120+ }
112121 envMap , err := argUtils .ProcessArgs (e , execArgs , nil )
113122 if err != nil {
114123 logger .FatalErr (err )
115124 }
116- s , err := store .NewStore ()
125+ s , err := store .NewStore (store . Path () )
117126 if err != nil {
118127 logger .FatalErr (err )
119128 }
@@ -145,7 +154,7 @@ func execFunc(ctx *context.Context, cmd *cobra.Command, verb executable.Verb, ar
145154 logger .FatalErr (err )
146155 }
147156 dur := time .Since (startTime )
148- processStore , err := store .NewStore ()
157+ processStore , err := store .NewStore (store . Path () )
149158 if err != nil {
150159 logger .Errorf ("failed clearing process store\n %v" , err )
151160 }
@@ -369,6 +378,14 @@ Flag arguments are specified with the format 'flag=value' and positional argumen
369378`
370379 execExamples = `
371380#### Examples
381+ **Execute a nameless flow in the current workspace with the 'install' verb**
382+
383+ flow install
384+
385+ **Execute a nameless flow in the 'ws' workspace with the 'test' verb**
386+
387+ flow test ws
388+
372389**Execute the 'build' flow in the current workspace and namespace**
373390
374391flow exec build
0 commit comments