Skip to content

Commit

Permalink
docs: improve commands generation (#1446)
Browse files Browse the repository at this point in the history
* docs: improve commands generation

* fix: linter

* refactor: move logic to doc gen

* fix: make api key visible

* chore: always show aliases

* chore: clean up

* fix: update snapshots
  • Loading branch information
cfabianski authored Dec 21, 2023
1 parent cb24f3a commit f493379
Show file tree
Hide file tree
Showing 27 changed files with 430 additions and 129 deletions.
2 changes: 1 addition & 1 deletion docs/_data/bearer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ see_also:
- bearer init - Generates a default config to `bearer.yml`
- bearer scan - Scan a directory or file
- bearer version - Print the version
aliases:
aliases: []
2 changes: 1 addition & 1 deletion docs/_data/bearer_completion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ options:
usage: help for completion
see_also:
- "bearer - "
aliases:
aliases: []
33 changes: 23 additions & 10 deletions docs/_data/bearer_ignore_add.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,65 @@ usage: bearer ignore add <fingerprint> [flags]
options:
- name: api-key
usage: Use your Bearer API Key to send the report to Bearer.
environment_variables:
- BEARER_API_KEY
- name: author
shorthand: a
usage: |
Add author information to this ignored finding. (default output of "git config user.name")
environment_variables:
- BEARER_AUTHOR
- name: comment
usage: Add a comment to this ignored finding.
environment_variables:
- BEARER_COMMENT
- name: config-file
default_value: bearer.yml
usage: Load configuration from the specified path.
environment_variables:
- BEARER_CONFIG_FILE
- name: debug
default_value: "false"
usage: Enable debug logs. Equivalent to --log-level=debug
- name: debug-profile
default_value: "false"
usage: Generate profiling data for debugging
environment_variables:
- BEARER_DEBUG
- name: disable-version-check
default_value: "false"
usage: Disable Bearer version checking
environment_variables:
- BEARER_DISABLE_VERSION_CHECK
- name: false-positive
default_value: "false"
usage: Mark an this ignored finding as false positive.
environment_variables:
- BEARER_FALSE_POSITIVE
- name: force
default_value: "false"
usage: Overwrite an existing ignored finding.
environment_variables:
- BEARER_FORCE
- name: help
shorthand: h
default_value: "false"
usage: help for add
- name: host
default_value: my.bearer.sh
usage: Specify the Host for sending the report.
- name: ignore-file
default_value: bearer.ignore
usage: Load ignore file from the specified path.
- name: ignore-git
default_value: "false"
usage: Ignore Git listing
environment_variables:
- BEARER_IGNORE_FILE
- name: log-level
default_value: info
usage: Set log level (error, info, debug, trace)
environment_variables:
- BEARER_LOG_LEVEL
- name: no-color
default_value: "false"
usage: Disable color in output
environment_variables:
- BEARER_NO_COLOR
example: |-
# Add an ignored fingerprint to your ignore file
$ bearer ignore add <fingerprint> --author Mish --comment "Possible false positive"
see_also:
- bearer ignore - Manage ignored fingerprints
aliases:
aliases: []
27 changes: 17 additions & 10 deletions docs/_data/bearer_ignore_migrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,50 @@ usage: bearer ignore migrate [flags]
options:
- name: api-key
usage: Use your Bearer API Key to send the report to Bearer.
environment_variables:
- BEARER_API_KEY
- name: config-file
default_value: bearer.yml
usage: Load configuration from the specified path.
environment_variables:
- BEARER_CONFIG_FILE
- name: debug
default_value: "false"
usage: Enable debug logs. Equivalent to --log-level=debug
- name: debug-profile
default_value: "false"
usage: Generate profiling data for debugging
environment_variables:
- BEARER_DEBUG
- name: disable-version-check
default_value: "false"
usage: Disable Bearer version checking
environment_variables:
- BEARER_DISABLE_VERSION_CHECK
- name: force
default_value: "false"
usage: Overwrite an existing ignored finding.
environment_variables:
- BEARER_FORCE
- name: help
shorthand: h
default_value: "false"
usage: help for migrate
- name: host
default_value: my.bearer.sh
usage: Specify the Host for sending the report.
- name: ignore-file
default_value: bearer.ignore
usage: Load ignore file from the specified path.
- name: ignore-git
default_value: "false"
usage: Ignore Git listing
environment_variables:
- BEARER_IGNORE_FILE
- name: log-level
default_value: info
usage: Set log level (error, info, debug, trace)
environment_variables:
- BEARER_LOG_LEVEL
- name: no-color
default_value: "false"
usage: Disable color in output
environment_variables:
- BEARER_NO_COLOR
example: |-
# Migrate existing ignored (excluded) fingerprints from bearer.yml file to ignore file
$ bearer ignore migrate
see_also:
- bearer ignore - Manage ignored fingerprints
aliases:
aliases: []
25 changes: 15 additions & 10 deletions docs/_data/bearer_ignore_pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,45 @@ usage: bearer ignore pull <path> [flags]
options:
- name: api-key
usage: Use your Bearer API Key to send the report to Bearer.
environment_variables:
- BEARER_API_KEY
- name: config-file
default_value: bearer.yml
usage: Load configuration from the specified path.
environment_variables:
- BEARER_CONFIG_FILE
- name: debug
default_value: "false"
usage: Enable debug logs. Equivalent to --log-level=debug
- name: debug-profile
default_value: "false"
usage: Generate profiling data for debugging
environment_variables:
- BEARER_DEBUG
- name: disable-version-check
default_value: "false"
usage: Disable Bearer version checking
environment_variables:
- BEARER_DISABLE_VERSION_CHECK
- name: help
shorthand: h
default_value: "false"
usage: help for pull
- name: host
default_value: my.bearer.sh
usage: Specify the Host for sending the report.
- name: ignore-file
default_value: bearer.ignore
usage: Load ignore file from the specified path.
- name: ignore-git
default_value: "false"
usage: Ignore Git listing
environment_variables:
- BEARER_IGNORE_FILE
- name: log-level
default_value: info
usage: Set log level (error, info, debug, trace)
environment_variables:
- BEARER_LOG_LEVEL
- name: no-color
default_value: "false"
usage: Disable color in output
environment_variables:
- BEARER_NO_COLOR
example: |-
# Pull ignored fingerprints from the Cloud (requires API key)
$ bearer ignore pull /path/to/your_project --api-key=XXXXX
see_also:
- bearer ignore - Manage ignored fingerprints
aliases:
aliases: []
25 changes: 15 additions & 10 deletions docs/_data/bearer_ignore_remove.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,45 @@ usage: bearer ignore remove <fingerprint> [flags]
options:
- name: api-key
usage: Use your Bearer API Key to send the report to Bearer.
environment_variables:
- BEARER_API_KEY
- name: config-file
default_value: bearer.yml
usage: Load configuration from the specified path.
environment_variables:
- BEARER_CONFIG_FILE
- name: debug
default_value: "false"
usage: Enable debug logs. Equivalent to --log-level=debug
- name: debug-profile
default_value: "false"
usage: Generate profiling data for debugging
environment_variables:
- BEARER_DEBUG
- name: disable-version-check
default_value: "false"
usage: Disable Bearer version checking
environment_variables:
- BEARER_DISABLE_VERSION_CHECK
- name: help
shorthand: h
default_value: "false"
usage: help for remove
- name: host
default_value: my.bearer.sh
usage: Specify the Host for sending the report.
- name: ignore-file
default_value: bearer.ignore
usage: Load ignore file from the specified path.
- name: ignore-git
default_value: "false"
usage: Ignore Git listing
environment_variables:
- BEARER_IGNORE_FILE
- name: log-level
default_value: info
usage: Set log level (error, info, debug, trace)
environment_variables:
- BEARER_LOG_LEVEL
- name: no-color
default_value: "false"
usage: Disable color in output
environment_variables:
- BEARER_NO_COLOR
example: |-
# Remove an ignored fingerprint from your ignore file
$ bearer ignore remove <fingerprint>
see_also:
- bearer ignore - Manage ignored fingerprints
aliases:
aliases: []
27 changes: 17 additions & 10 deletions docs/_data/bearer_ignore_show.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,49 @@ options:
- name: all
default_value: "false"
usage: Show all ignored fingerprints.
environment_variables:
- BEARER_ALL
- name: api-key
usage: Use your Bearer API Key to send the report to Bearer.
environment_variables:
- BEARER_API_KEY
- name: config-file
default_value: bearer.yml
usage: Load configuration from the specified path.
environment_variables:
- BEARER_CONFIG_FILE
- name: debug
default_value: "false"
usage: Enable debug logs. Equivalent to --log-level=debug
- name: debug-profile
default_value: "false"
usage: Generate profiling data for debugging
environment_variables:
- BEARER_DEBUG
- name: disable-version-check
default_value: "false"
usage: Disable Bearer version checking
environment_variables:
- BEARER_DISABLE_VERSION_CHECK
- name: help
shorthand: h
default_value: "false"
usage: help for show
- name: host
default_value: my.bearer.sh
usage: Specify the Host for sending the report.
- name: ignore-file
default_value: bearer.ignore
usage: Load ignore file from the specified path.
- name: ignore-git
default_value: "false"
usage: Ignore Git listing
environment_variables:
- BEARER_IGNORE_FILE
- name: log-level
default_value: info
usage: Set log level (error, info, debug, trace)
environment_variables:
- BEARER_LOG_LEVEL
- name: no-color
default_value: "false"
usage: Disable color in output
environment_variables:
- BEARER_NO_COLOR
example: |-
# Show the details of an ignored fingerprint from your ignore file
$ bearer ignore show <fingerprint>
see_also:
- bearer ignore - Manage ignored fingerprints
aliases:
aliases: []
2 changes: 1 addition & 1 deletion docs/_data/bearer_init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ options:
usage: help for init
see_also:
- "bearer - "
aliases:
aliases: []
Loading

0 comments on commit f493379

Please sign in to comment.