feat: supports the default command fallback when command not found ( resolved #277 )
add an alias 'default' to set a default command.
Thanks for the contribution! Before we can merge this, we need @snowyu to sign the Salesforce.com Contributor License Agreement.
Codecov Report
Merging #139 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #139 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 2 2
Lines 12 12
Branches 3 3
======================================
Misses 12 12
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update db13f7e...a3a7850. Read the comment docs.
You should do this with the command_not_found hook https://oclif.io/docs/hooks
command_not_found can not do this operation unless it accepts a new command return and do not throw exception:
if (!c) {
await this.runHook('command_not_found', {id})
throw new CLIError(`command ${id} not found`)
You are correct, I misread earlier. See my comment https://github.com/oclif/oclif/issues/277#issuecomment-668271675 on adding a root index command. Thanks for the PR on this! I really don't like to not use your efforts, but this particular solution was an edge case that was easier for me to write than explain.