crashappsec / crashappsec/chalk
`chalk foo` should error unless `foo` is a valid command
- Dominant language
- Nim
- Stars
- 436
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
## Example
Run chalk with an invalid command name, such as:
```shell
chalk inserrt my_artifact
```
## Expected behavior
Produce an error, saying that `inserrt` is not a valid command name.
For example, in other tools:
```console
$ git checkoutt main
git: 'checkoutt' is not a git command. See 'git --help'.
The most similar command is
checkout
```
```console
$ docker buildd
docker: 'buildd' is not a docker command.
See 'docker --help'
```
## Observed behavior
Exits with an exit status of 0, after searching the docs for the invalid command:
```console
$ chalk inserrt my_artifact
Searching Documentation For Terms: Inserrt, My_Artifact
No Matches Found In Command-Line Flag Documentation
No Matches In Configuration Variables
No Matches In Found Metadata Key Docs
No Matches In Other Documents.
```
## Impact and discussion
A user may make a typo when adding chalk commands to scripts. Currently, this would cause unexpected behavior more quietly than it should.
I also do not expect `chalk foo` to search the docs for `foo`, and I can't think of a CLI tool that does that. I think that searching the docs should be explicit.
Contributor guide
No contributing guide indexed for this repository
Research direction
No source file or test is named in the issue. Reproduce the `chalk inserrt my_artifact` command, then trace the CLI command-dispatch entry point to see why an unknown command reaches documentation search. Done means an invalid command produces a clear error instead of searching documentation or exiting successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nim
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100