GithubHelp home page GithubHelp logo

Comments (2)

ivan avatar ivan commented on May 30, 2024

Debugging with

diff --git a/args.js b/args.js
index b1c4a68..0d56244 100644
--- a/args.js
+++ b/args.js
@@ -328,4 +328,5 @@ Object.keys(args).filter(optionName => optionName.includes("-"))
    .forEach(optionName => delete args[optionName]);
 delete args["$0"];
 delete args["_"];
+console.log(args);
 module.exports = args;

shows that when --browser-script comes after --browser-executable-path, url goes missing in the arguments, and the URL gets appended to browserScripts instead:

-url: 'https://www.google.com/',
-browserScripts: [ '/home/at/trash/remove-images.js' ],
+browserScripts: [ '/home/at/trash/remove-images.js', 'https://www.google.com/' ],

from single-file-cli.

ivan avatar ivan commented on May 30, 2024

Based on https://github.com/yargs/yargs/blob/main/docs/tricks.md#arrays and https://github.com/yargs/yargs/blob/main/docs/api.md#array, it looks like it would be possible to remove all the .array(...) from args.js and still get arrays from yargs when an --option is given twice or more.

The only implementation annoyance there is that --browser-script one.js results in a string from yargs (not in an array), while --browser-script one.js --browser-script two.js results in an array with two strings.

from single-file-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.