Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add helpful output to the help command #69

Merged
merged 3 commits into from
May 15, 2023

Conversation

baruchiro
Copy link
Contributor

  • make functions private
  • add helpful examples for -h/--help/help

Close #43

❯ go run .
2ms Secrets Detection: A tool to detect secrets in public websites and communication services.

Usage:
  2ms [command]

Plugins
  confluence  Scan Confluence server
  discord     Scan Discord server
  repository  Scan local repository

Additional Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command

Flags:
  -h, --help               help for 2ms
      --log-level string   log level (trace, debug, info, warn, error, fatal) (default "info")
      --tags strings       select rules to be applied (default [all])
  -v, --version            version for 2ms

Use "2ms [command] --help" for more information about a command.
❯ go run . help confluence
Scan Confluence server for sensitive information

Usage:
  2ms confluence --url URL [flags]

Flags:
  -h, --help                 help for confluence
      --history              Scan pages history
      --spaces stringArray   Confluence spaces: The names or IDs of the spaces to scan
      --token string         The Confluence API token for authentication
      --url string           Confluence server URL (example: https://company.atlassian.net/wiki) [required]
      --username string      Confluence user name or email for authentication

Global Flags:
      --log-level string   log level (trace, debug, info, warn, error, fatal) (default "info")
      --tags strings       select rules to be applied (default [all])
❯ go run . help discord
Scan Discord server for sensitive information.

Usage:
  2ms discord --token TOKEN --server SERVER [flags]

Flags:
      --channel stringArray   Discord channels IDs to scan. If not provided, all channels will be scanned
      --duration duration     The time interval to scan from the current time. For example, 24h for 24 hours or 7d for 7 days. (default 336h0m0s)
  -h, --help                  help for discord
      --messages-count int    The number of messages to scan. If not provided, all messages will be scanned until the fromDate flag value.
      --server stringArray    Discord servers IDs to scan [required]
      --token string          Discord token [required]

Global Flags:
      --log-level string   log level (trace, debug, info, warn, error, fatal) (default "info")
      --tags strings       select rules to be applied (default [all])
❯ go run . help repository
Scan local repository for sensitive information

Usage:
  2ms repository --path PATH [flags]

Flags:
  -h, --help          help for repository
      --path string   Local repository path [required]

Global Flags:
      --log-level string   log level (trace, debug, info, warn, error, fatal) (default "info")
      --tags strings       select rules to be applied (default [all])

@baruchiro
Copy link
Contributor Author

Waits for #61

@github-actions
Copy link

github-actions bot commented May 14, 2023

kics-logo

KICS version: v1.7.0

Category Results
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 1
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 1
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 49
Queries failed to execute placeholder 0
Execution time placeholder 2

Baruch Odem added 2 commits May 14, 2023 18:53
(cherry picked from commit 413be08)
(cherry picked from commit 35c750d)
@baruchiro baruchiro force-pushed the baruchiro/-h-/---help-->-add-helpful-examples branch from 35c750d to 494fce6 Compare May 14, 2023 15:53
@baruchiro baruchiro marked this pull request as ready for review May 14, 2023 15:54
cmd/main.go Outdated Show resolved Hide resolved
@jossef jossef merged commit 245203a into master May 15, 2023
@jossef jossef deleted the baruchiro/-h-/---help-->-add-helpful-examples branch May 15, 2023 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-h / --help -> add helpful examples
2 participants