Skip to content

Commit

Permalink
docs(repo): update trivy repo usage and example
Browse files Browse the repository at this point in the history
  • Loading branch information
fbufler committed Aug 27, 2023
1 parent 5d8da70 commit db6ad87
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/docs/references/configuration/cli/trivy.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ trivy [global flags] command [flags] target
* [trivy kubernetes](trivy_kubernetes.md) - [EXPERIMENTAL] Scan kubernetes cluster
* [trivy module](trivy_module.md) - Manage modules
* [trivy plugin](trivy_plugin.md) - Manage plugins
* [trivy repository](trivy_repository.md) - Scan a remote repository
* [trivy repository](trivy_repository.md) - Scan a repository
* [trivy rootfs](trivy_rootfs.md) - Scan rootfs
* [trivy sbom](trivy_sbom.md) - Scan SBOM for vulnerabilities
* [trivy server](trivy_server.md) - Server mode
Expand Down
6 changes: 4 additions & 2 deletions docs/docs/references/configuration/cli/trivy_repository.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
## trivy repository

Scan a remote repository
Scan a repository

```
trivy repository [flags] REPO_URL
trivy repository [flags] (REPO_PATH | REPO_URL)
```

### Examples

```
# Scan your remote git repository
$ trivy repo https://github.com/knqyf263/trivy-ci-test
# Scan your local git repository
$ trivy repo /path/to/your/repository
```

### Options
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/target/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ It is disabled by default and can be enabled with `--scanners config`.
See [here](../scanner/misconfiguration/index.md) for the detail.

```shell
$ trivy repo --scanners config [YOUR_REPO_URL]
$ trivy repo --scanners config (REPO_PATH | REPO_URL)
```

### Secrets
It is enabled by default.
See [here](../scanner/secret.md) for the detail.

```shell
$ trivy repo [YOUR_REPO_URL]
$ trivy repo (REPO_PATH | REPO_URL)
```

### Licenses
It is disabled by default.
See [here](../scanner/license.md) for the detail.

```shell
$ trivy repo --scanners license [YOUR_REPO_URL]
$ trivy repo --scanners license (REPO_PATH | REPO_URL)
```

## SBOM generation
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/shell/shell-completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ image -- Scan a container image
kubernetes -- scan kubernetes cluster
module -- Manage modules
plugin -- Manage plugins
repository -- Scan a remote repository
repository -- Scan a repository
rootfs -- Scan rootfs
sbom -- Scan SBOM for vulnerabilities
server -- Server mode
Expand Down
8 changes: 5 additions & 3 deletions pkg/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,14 @@ func NewRepositoryCommand(globalFlags *flag.GlobalFlagGroup) *cobra.Command {
repoFlags.ReportFlagGroup.ExitOnEOL = nil // disable '--exit-on-eol'

cmd := &cobra.Command{
Use: "repository [flags] REPO_URL",
Use: "repository [flags] (REPO_PATH | REPO_URL)",
Aliases: []string{"repo"},
GroupID: groupScanning,
Short: "Scan a remote repository",
Short: "Scan a repository",
Example: ` # Scan your remote git repository
$ trivy repo https://github.com/knqyf263/trivy-ci-test`,
$ trivy repo https://github.com/knqyf263/trivy-ci-test
# Scan your local git repository
$ trivy repo /path/to/your/repository`,
PreRunE: func(cmd *cobra.Command, args []string) error {
if err := repoFlags.Bind(cmd); err != nil {
return xerrors.Errorf("flag bind error: %w", err)
Expand Down

0 comments on commit db6ad87

Please sign in to comment.