From dd67e6f06ef7f49b1c2bb7a1a13a542335f0cc86 Mon Sep 17 00:00:00 2001 From: Roy Sindre Norangshol Date: Wed, 21 Aug 2019 12:34:26 +0200 Subject: [PATCH] Fixes command line arguments parsing Use the provided args._ which contains all undefined parameters. This solved using the --sock parameter. Before this you would simply get: 'error: unknown command: --sock' because commandName would be set to the value of --sock argument. --- client.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client.coffee b/client.coffee index c8cf2e9..4090fc9 100644 --- a/client.coffee +++ b/client.coffee @@ -16,8 +16,7 @@ if args.help chromix = require("./chromix-too")(args.sock).chromix [ commandName, commandArgs ] = - if 2 < process.argv.length then [ process.argv[2], process.argv[3...] ] else [ "ping", [] ] - + if 0 < args._.length then [ args._[0], args._[1...] ] else [ "ping", [] ] # Extract the query flags (for chrome.tabs.query) from the arguments. Return the new arguments and the # query-flags object. getQueryFlags = (commandArgs) ->