Skip to content

Commit

Permalink
Fix usage of short forms for flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krivak authored and svishwanath-tw committed Oct 12, 2019
1 parent 433da79 commit 686fe88
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 32 deletions.
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
- [Talisman HTML Reporting](#talisman-html-reporting)
- [Uninstallation](#uninstallation)
- [From a global hook template](#uninstallation-from-a-global-hook-template)
- [From a single repository](#uninstallation-from-a-single-repository)
- [From a single repository](#uninstallation-from-a-single-repository)
- [Contributing to Talisman](#contributing-to-talisman)
- [Developing locally](#developing-locally)
- [Releasing](#releasing)
- [Releasing](#releasing)

# What is Talisman?
Talisman is a tool that installs a hook to your repository to ensure that potential secrets or sensitive information do not leave the developer's workstation.
Expand Down Expand Up @@ -250,7 +250,7 @@ fileignoreconfig:
checksum: cf97abd34cebe895417eb4d97fbd7374aa138dcb65b1fe7f6b6cc1238aaf4d48
ignore_detectors: []
```
Entering this in the `.talismanrc` file will ensure that Talisman will ignore the `danger.pem` file as long as the checksum matches the value mentioned in the `checksum` field.
Entering this in the `.talismanrc` file will ensure that Talisman will ignore the `danger.pem` file as long as the checksum matches the value mentioned in the `checksum` field.

### Ignoring specific detectors

Expand Down Expand Up @@ -301,11 +301,11 @@ scopeconfig:
- scope: node
```

Talisman is configured to ignore certain files based on the specified scope. For example, mentioning the node scope in the scopeconfig will prevent talisman from scanning files such as the yarn.lock or package-lock.json.
Talisman is configured to ignore certain files based on the specified scope. For example, mentioning the node scope in the scopeconfig will prevent talisman from scanning files such as the yarn.lock or package-lock.json.

You can specify multiple scopes.
You can specify multiple scopes.

Currently .talismanrc only supports scopeconfig support for go and node. Other scopes will be added shortly.
Currently .talismanrc only supports scopeconfig support for go and node. Other scopes will be added shortly.

<br/><i>
**Note**: The use of .talismanignore has been deprecated. File .talismanrc replaces it because:
Expand All @@ -319,17 +319,14 @@ Currently .talismanrc only supports scopeconfig support for go and node. Other s
If you execute `talisman` on the command line, you will be able to view all the parameter options you can pass

```
--c string short form of checksum calculator
--checksum string checksum calculator calculates checksum and suggests .talsimarc format
--d short form of debug
--debug enable debug mode (warning: very verbose)
--githook string either pre-push or pre-commit (default "pre-push")
--p string short form of pattern
--pattern string pattern (glob-like) of files to scan (ignores githooks)
--s short form of scanner
--scan scanner scans the git commit history for potential secrets
--v short form of version
--version show current version of talisman
-c, --checksum string checksum calculator calculates checksum and suggests .talsimarc format
-d, --debug enable debug mode (warning: very verbose)
-g, --githook string either pre-push or pre-commit (default "pre-push")
-p, --pattern string pattern (glob-like) of files to scan (ignores githooks)
-r, --reportdirectory string directory where the scan reports will be stored
-s, --scan scanner scans the git commit history for potential secrets
-w, --scanWithHtml generate html report (**Make sure you have installed talisman_html_report to use this, as mentioned in Readme**)
-v, --version show current version of talisman
```


Expand Down
23 changes: 8 additions & 15 deletions talisman.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,14 @@ type options struct {

//Logger is the default log device, set to emit at the Error level by default
func main() {
flag.BoolVar(&fdebug, "d", false, "short form of debug")
flag.BoolVar(&fdebug, "debug", false, "enable debug mode (warning: very verbose)")
flag.BoolVar(&showVersion, "v", false, "short form of version")
flag.BoolVar(&showVersion, "version", false, "show current version of talisman")
flag.StringVar(&pattern, "p", "", "short form of pattern")
flag.StringVar(&pattern, "pattern", "", "pattern (glob-like) of files to scan (ignores githooks)")
flag.StringVar(&githook, "githook", PrePush, "either pre-push or pre-commit")
flag.BoolVar(&scan, "s", false, "short form of scanner")
flag.BoolVar(&scan, "scan", false, "scanner scans the git commit history for potential secrets")
flag.StringVar(&checksum, "c", "", "short form of checksum calculator")
flag.StringVar(&checksum, "checksum", "", "checksum calculator calculates checksum and suggests .talsimarc format")
flag.StringVar(&reportdirectory, "reportdirectory", "", "directory where the scan reports will be stored")
flag.StringVar(&reportdirectory, "rd", "", "short form of report directory")
flag.BoolVar(&scanWithHtml, "scanWithHtml", false, "Generate html report. (**Make sure you have installed talisman_html_report to use this, as mentioned in Readme)**")
flag.BoolVar(&scanWithHtml, "swh", false, "short form of html report scanner")
flag.BoolVarP(&fdebug, "debug", "d", false, "enable debug mode (warning: very verbose)")
flag.BoolVarP(&showVersion, "version", "v", false, "show current version of talisman")
flag.StringVarP(&pattern, "pattern", "p", "", "pattern (glob-like) of files to scan (ignores githooks)")
flag.StringVarP(&githook, "githook", "g", PrePush, "either pre-push or pre-commit")
flag.BoolVarP(&scan, "scan", "s", false, "scanner scans the git commit history for potential secrets")
flag.StringVarP(&checksum, "checksum", "c", "", "checksum calculator calculates checksum and suggests .talsimarc format")
flag.StringVarP(&reportdirectory, "reportdirectory", "r", "", "directory where the scan reports will be stored")
flag.BoolVarP(&scanWithHtml, "scanWithHtml", "w", false, "generate html report (**Make sure you have installed talisman_html_report to use this, as mentioned in Readme**)")

flag.Parse()

Expand Down

0 comments on commit 686fe88

Please sign in to comment.