diff options
| author | nytpu <alex@nytpu.com> | 2021-03-18 13:48:26 -0600 |
|---|---|---|
| committer | nytpu <alex@nytpu.com> | 2021-03-18 13:48:26 -0600 |
| commit | a80d3f29ff0b76cea00672f24c408695ac8957d6 (patch) | |
| tree | 20592a251342cfef81ad6532d5ea2a41811e66d2 | |
| parent | 326edc97c5b20ba0fed5a7d770d8fd61d0215ed3 (diff) | |
add flag for number of refresh workers
| -rw-r--r-- | comitium.go | 4 | ||||
| -rw-r--r-- | flags.go | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/comitium.go b/comitium.go index 3c092d1..5129b70 100644 --- a/comitium.go +++ b/comitium.go @@ -161,8 +161,8 @@ func usage() { fmt.Fprintf(os.Stderr, "\nGlobal Flags:\n%v", globalFs.FlagUsages()) // command-specific flags should be printed here - fmt.Fprintf(os.Stderr, "Flags for \"add\":\n%v\n", commands["add"].FlagUsages()) + fmt.Fprintf(os.Stderr, "Flags for \"add\":\n%v", commands["add"].FlagUsages()) + fmt.Fprintf(os.Stderr, "Flags for \"refresh\":\n%v\n", commands["refresh"].FlagUsages()) - //fmt.Fprintf(os.Stderr, "To see specific details for a command, run \"%v <command> -h\"\n", os.Args[0]) fmt.Fprint(os.Stderr, "For more help, see comitium(1).\n") } @@ -40,8 +40,15 @@ var commands = map[string]*flag.FlagSet{ var ( // add addTypeFlag = commands["add"].BoolP( - "watch", "w", // long and shorthand flag - false, // default + "watch", "w", + false, `Watch a page instead of adding it as a feed.`, ) + + refreshWorkersFlag = commands["refresh"].IntP( + "num-workers", "n", + 5, // 5 workers is a safe default + `Number of worker threads to use when refreshing feeds. More is faster, +but there are more concurrent outgoing requests then.`, + ) ) |
