Skip to content

Default command invoked when calling .showHelp #1791

@wesleytodd

Description

@wesleytodd
const yargs = require('yargs')

yargs.command('$0', 'a default command', (yargs) => yargs, () => {
  console.log('default command!! why?')
})
yargs.showHelp((output) => {
  console.log(output)
})

The above application will also execute the default command even though we never called .argv or .parse. This seems like unexpected behavior to me and I could not find any docs on this. Is this intended for some reason I am unaware of?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions