question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Short args can't be used with =

See original GitHub issue

Short args can’t be used with =. Is this intentional?

const arg = require('arg')

arg({
  '-a': String
})
node example.js -a=a

Results in:

                                        throw new TypeError(`Option requires argument (but was followed by another short argument): ${originalArgName}`);
                                        ^

TypeError: Option requires argument (but was followed by another short argument): -a
    at arg (<path>/node_modules/arg/index.js:97:12)
    at Object.<anonymous> (<path>/example.js:5:1)

A similar error happens for aliases:

const arg = require('arg')

arg({
  '--a': String,
  '-a': '--a'
})

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Qix-commented, Oct 15, 2020

Going to close this as I don’t think there’s anything actionable. Thank you for the input 😃

0reactions
jaeee5commented, Nov 2, 2022

Hi i dont know is anyone can help but i am getting this error when attempting to run vercel deploy -prebuilt

throw new ArgError(option requires argument: ${originalArgName}${extended}, 'ARG_MISSING_REQUIRED_LONGARG');

Read more comments on GitHub >

github_iconTop Results From Across the Web

Short args can't be used with = · Issue #51 · vercel/arg - GitHub
A short arg with an equal sign is not part of the GNU command line arguments guidelines (which arg tries to follow as...
Read more >
A Simple Guide To Command Line Arguments With ArgParse
ArgumentParser () initializes the parser so that you can start to add custom arguments. To add your arguments, use parser.add_argument() . Some ...
Read more >
Arg in clap - Rust - Docs.rs
The abstract representation of a command line argument. Used to set all the options and relationships that define a valid argument for the...
Read more >
Argparse Tutorial — Python 3.11.1 documentation
python3 prog.py -h usage: prog.py [-h] echo positional arguments: echo echo the string you use here options: -h, --help show this help message...
Read more >
argparse – Command line option and argument parsing.
The first step when using argparse is to create a parser object and tell it what arguments to expect. The parser can then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found