Skip to content

arg parser: Command name cannot match "full" #36

@abdulito

Description

@abdulito

For example

cmdargs: {
  me: {
    command: true,
    full: "me"
 },
...

This will barf on this line

delete commands[fullCommand].full

In this case you would just not specify full and it would work but it took me a while to figure that out since i was copying commands from a template.

TypeError: Cannot convert undefined or null to object
    at Atom._initArgParser (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:620:24)
    at Atom._processCmdargs (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:502:10)
    at Atom._invokeMain (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:412:27)
    at Atom._runMain (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:403:12)
    at Atom._makeObject (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:162:16)
    at Atom.make (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:117:24)
    at /Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:791:19
    at /Users/abdul/github/mlab/mlab-cli/bin/mlab:8:3
    at fiberFunction (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/fibers/index.js:219:13)
Exception caught with error undefined in fibers.spawn: TypeError: Cannot convert undefined or null to object
    at Atom._initArgParser (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:620:24)
    at Atom._processCmdargs (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:502:10)
    at Atom._invokeMain (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:412:27)
    at Atom._runMain (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:403:12)
    at Atom._makeObject (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:162:16)
    at Atom.make (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:117:24)
    at /Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/atom/lib/atom.js:791:19
    at /Users/abdul/github/mlab/mlab-cli/bin/mlab:8:3
    at fiberFunction (/Users/abdul/github/mlab/mlab-cli/node_modules/@carbon-io/fibers/index.js:219:13)

This is because delete commands[fullCommand] attempts to delete an entry that doesn't exist anymore since it was deleted by delete commands[command]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions