Skip to content

Commit

Permalink
removed mandatory txt and json extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
p34rpr3sh4 committed Nov 24, 2022
1 parent f45f6a8 commit 9fde440
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func init() {
rootCmd.Flags().IntP("min-word-length", "m", 3, "Minimum word length")
rootCmd.Flags().IntP("max-word-length", "n", 24, "Maximum word length")
rootCmd.Flags().StringSlice("scope", []string{}, "Additional site scope, for example subdomains. If not set, only the provided site's domains are in scope. Using * disables scope checks (careful)")
rootCmd.Flags().StringP("output", "o", "", "When set, write an output file to <value>.txt (<value>.json when --json is specified). Empty writes no output to disk")
rootCmd.Flags().StringP("output", "o", "", "When set, write an output file")
rootCmd.Flags().StringP("url-filter", "u", "", "Filter URL by regexp. .ie: \"(.*\\.)?domain\\.com.*\". Setting this will ignore scope")
rootCmd.Flags().Bool("no-filter", false, "Do not filter out strings that don't match the regex to check if it looks like a valid word (starts and ends with alphanumeric letter, anything else in between). Also ignores --min-word-length and --max-word-length")
rootCmd.Flags().Bool("json", false, "Write words + counts in a json file. Requires --output/-o")
Expand Down Expand Up @@ -245,7 +245,7 @@ func outputResults(config *skweezConf, cache map[string]int) {
handleErr(err, false)
if config.output != "" {
mode := os.O_RDWR | os.O_CREATE
filedescriptor, err := os.OpenFile(config.output+".json", mode, 0644)
filedescriptor, err := os.OpenFile(config.output, mode, 0644)
handleErr(err, true)
defer filedescriptor.Close()
filedescriptor.Write(jsonString)
Expand All @@ -255,7 +255,7 @@ func outputResults(config *skweezConf, cache map[string]int) {
} else {
if config.output != "" {
mode := os.O_RDWR | os.O_CREATE
filedescriptor, err := os.OpenFile(config.output+".txt", mode, 0644)
filedescriptor, err := os.OpenFile(config.output, mode, 0644)
handleErr(err, true)
defer filedescriptor.Close()
for word := range cache {
Expand Down

0 comments on commit 9fde440

Please sign in to comment.