yargs: Wrong $0 in bundled electron app

We have an election app that is bundled to an .exe file.

A command line like bundled.exe -f filename will result in: { _: ['filename'], '$0': 'bundled.exe -f' }

The following workaround: const argv = yargs.parse(process.argv.slice(1)); will result in { _: [], f: 'filename', '$0': 'bundled.exe -f' }

Please notice that the $0 ist still wrong because it contains the “-f”.

If this an expected behavior? Is there a way to work around it?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 15 (13 by maintainers)

Most upvoted comments

@shadowspawn thanks for helping to sort this out.

Working fine now in my tests, args getting sliced at correct point.