maorleger commented on code in PR #441:
URL: https://github.com/apache/arrow-js/pull/441#discussion_r3367852174


##########
gulp/argv.js:
##########
@@ -15,18 +15,32 @@
 // specific language governing permissions and limitations
 // under the License.
 
-import args from 'command-line-args';
-export const argv = args([
-    { name: `all`, type: Boolean },
-    { name: 'verbose', alias: `v`, type: Boolean },
-    { name: `target`, type: String, defaultValue: `` },
-    { name: `module`, type: String, defaultValue: `` },
-    { name: `coverage`, type: Boolean, defaultValue: false },
-    { name: `tests`, type: String, multiple: true, defaultValue: 
[`test/unit/`] },
-    { name: `targets`, alias: `t`, type: String, multiple: true, defaultValue: 
[] },
-    { name: `modules`, alias: `m`, type: String, multiple: true, defaultValue: 
[] },
-], { partial: true });
+import { parseArgs } from 'node:util';
 
+const { values, tokens } = parseArgs({
+    options: {
+        all: { type: 'boolean' },
+        verbose: { type: 'boolean', short: 'v' },
+        target: { type: 'string', default: '' },
+        module: { type: 'string', default: '' },
+        coverage: { type: 'boolean', default: false },
+        tests: { type: 'string', multiple: true, default: ['test/unit/'] },
+        targets: { type: 'string', short: 't', multiple: true, default: [] },
+        modules: { type: 'string', short: 'm', multiple: true, default: [] },
+    },
+    args: process.argv.slice(2),
+    strict: false,
+    allowPositionals: true,
+    tokens: true,
+});
+
+// Expose unknown/positional tokens under `_unknown` for compatibility with
+// the previous command-line-args partial mode used by gulp/test-task.js.
+values._unknown = tokens
+    .filter((t) => t.kind === 'positional')
+    .map((t) => t.value);

Review Comment:
   Yes, good catch - I confirmed the regression and pushed up a fix for it 
(largely similar to what copilot suggested here).
   
   Would love to get another pass from copilot, I tried re-requesting review 
but of course I don't know if it'll trigger or not as an outside contributor. 
We'll see shortly 😄 
   
   ETA: ok, it did come back with sensible but expected comments. I don't think 
there's anything that requires changing there but I will leave them unresolved 
until y'all had a chance to review.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to