Repository navigation
Commit 24bab17
committed
fix: don't suggest hidden commands for unknown help topics
With Suggest enabled, "app help <name>" with an unknown name appends the
closest command name to the "No help topic" error, including commands
declared Hidden. With a hidden "putz" command, "app help put" fails
with:
No help topic for 'put'. putz
Hidden commands are already left out of help output and shell
completion, so leave them out of this suggestion too. Filter them at
this call site instead of in suggestCommand, because PrefixMatchCommands
also resolves command names through suggestCommand.
Fixes: 002bde2 ("Add suggestions support")
Assisted-by: claude:claude-opus-5-5
Signed-off-by: Eng Zer Jun <[email protected]>1 parent 3d526cf commit 24bab17
2 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
343 | 350 | | |
344 | 351 | | |
345 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2379 | 2379 | | |
2380 | 2380 | | |
2381 | 2381 | | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
2382 | 2402 | | |
2383 | 2403 | | |
2384 | 2404 | | |
| |||
0 commit comments