Skip to content

Commit

Permalink
readme, condense click exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
swashko committed Oct 5, 2023
1 parent 64b6c6b commit 2f45612
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ Remember models are just like any other form of digital media, you should scan c
**NOTE**: LLMs are large files, it can take a few minutes to download them before scanning. Expect the process
to take just a few minutes to complete.

##### CLI Exit Codes
The CLI exit status codes are:
- `0`: Scan completed successfully, no vulnerabilities found
- `1`: Scan completed successfully, vulnerabilities found
- `2`: Scan failed, modelscan threw an error while scanning
- `3`: No supported files were passed to the tool
- `4`: Usage error, CLI was passed invalid or incomplete options

### Understanding The Results

Once a scan has been completed you'll see output like this if an issue is found:
Expand All @@ -143,13 +151,6 @@ it allows an attacker to read our AWS credentials and write them to another plac

That is a firm NO for usage.

The CLI exit status codes are:
- `0`: Scan completed successfully, no vulnerabilities found
- `1`: Scan completed successfully, vulnerabilities found
- `2`: Scan failed, modelscan threw an error while scanning
- `3`: No supported files were passed to the tool
- `4`: Usage error, CLI was passed invalid or incomplete options

## Integrating ModelScan In Your ML Pipelines and CI/CD Pipelines

Ad-hoc scanning is a great first step, please drill it into yourself, peers, and friends to do
Expand Down
10 changes: 2 additions & 8 deletions modelscan/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,8 @@ def main() -> None:
try:
result = cli.main(standalone_mode=False)

except (
click.UsageError,
click.BadParameter,
click.BadOptionUsage,
click.NoSuchOption,
click.ClickException,
) as e:
click.echo(f"Usage Error: {e}")
except (click.ClickException,) as e:
click.echo(f"Error: {e}")
with click.Context(cli) as ctx:
click.echo(cli.get_help(ctx))
# exit code 4 for CLI usage errors
Expand Down

0 comments on commit 2f45612

Please sign in to comment.