Skip to content

fix: throw error if missing cmd arg#317

Merged
mshanemc merged 2 commits intomainfrom
cd/throw-missing-arg
Jan 17, 2023
Merged

fix: throw error if missing cmd arg#317
mshanemc merged 2 commits intomainfrom
cd/throw-missing-arg

Conversation

@cristiand391
Copy link
Copy Markdown
Member

Makes which command throw an error when a command wasn't specified.

Before:

➜  plugin-which git:(cd/throw-missing-arg) sfdx which
 ›   Error: command  not found

After:

➜  plugin-which git:(cd/throw-missing-arg) sfdx which
    Error: Missing 1 required arg

Comment thread src/commands/which.ts
]

async run(): Promise<void> {
const {argv} = await this.parse(Which)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this used to be an oclif arg, but we parse argv to support space-separated commands without quotes, see:
#194

Comment thread src/commands/which.ts Outdated
Co-authored-by: Shane McLaughlin <shane.mclaughlin@salesforce.com>
@mshanemc mshanemc merged commit 1b01e1c into main Jan 17, 2023
@mshanemc mshanemc deleted the cd/throw-missing-arg branch January 17, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants