File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,8 @@ const sanitizedDescription = description
2020const required = definition .demandOption ;
2121const defaultValue = definition .default ;
2222const alias = definition .alias ;
23- const positional = definition .positionalArgs ?.includes (key );
2423
25- const name = positional ? ` [${key .toUpperCase ()}] ` : ` --${key } ` ;
24+ const name = definition . positional ? ` [${key .toUpperCase ()}] ` : ` --${key } ` ;
2625
2726let typeText;
2827if (Array .isArray (type )) {
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ const { globalFlags } = commands;
2828const positionals = definition .positionalArgs
2929 ?.map ((p ) => ` [${p .toUpperCase ()}] ` )
3030 .join (" " );
31+
32+ const positionalSet = new Set (definition .positionalArgs );
3133---
3234
3335<AnchorHeading depth ={ headingLevel } title ={ ` \` ${command }\` ` } />
@@ -45,7 +47,12 @@ const positionals = definition.positionalArgs
4547 Object .entries (definition .args )
4648 .filter (([_ , value ]) => ! value .hidden )
4749 .map (([key , value ]) => {
48- return <WranglerArg key = { key } definition = { value } />;
50+ return (
51+ <WranglerArg
52+ key = { key }
53+ definition = { { ... value , positional: positionalSet .has (key ) }}
54+ />
55+ );
4956 })
5057 }
5158</ul >
You can’t perform that action at this time.
0 commit comments