File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const definition = getCommand(command);
2020description ?? = definition .metadata .description ;
2121
2222if (! definition .args ) {
23- throw new Error (` [WranglerCommand] "${command }" has no arguments ` );
23+ console . warn (` [WranglerCommand] "${command }" has no arguments ` );
2424}
2525
2626const { globalFlags } = commands ;
@@ -42,20 +42,23 @@ const positionalSet = new Set(definition.positionalArgs);
4242 args ={ positionals ? command .concat (` ${positionals } ` ) : command }
4343/>
4444
45- <ul >
46- {
47- Object .entries (definition .args )
48- .filter (([_ , value ]) => ! value .hidden )
49- .map (([key , value ]) => {
50- return (
51- <WranglerArg
52- key = { key }
53- definition = { { ... value , positional: positionalSet .has (key ) }}
54- />
55- );
56- })
57- }
58- </ul >
45+ <!-- CED-181 - Not all commands have specific arguments as part of the payload -->
46+ {
47+ definition .args && (
48+ <ul >
49+ { Object .entries (definition .args )
50+ .filter (([_ , value ]) => ! value .hidden )
51+ .map (([key , value ]) => {
52+ return (
53+ <WranglerArg
54+ key = { key }
55+ definition = { { ... value , positional: positionalSet .has (key ) }}
56+ />
57+ );
58+ })}
59+ </ul >
60+ )
61+ }
5962
6063<Details header =" Global flags" >
6164 <ul >
You can’t perform that action at this time.
0 commit comments