add flag for number of refresh workers
This commit is contained in:
+2
-2
@@ -161,8 +161,8 @@ func usage() {
|
|||||||
|
|
||||||
fmt.Fprintf(os.Stderr, "\nGlobal Flags:\n%v", globalFs.FlagUsages())
|
fmt.Fprintf(os.Stderr, "\nGlobal Flags:\n%v", globalFs.FlagUsages())
|
||||||
// command-specific flags should be printed here
|
// 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")
|
fmt.Fprint(os.Stderr, "For more help, see comitium(1).\n")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,15 @@ var commands = map[string]*flag.FlagSet{
|
|||||||
var (
|
var (
|
||||||
// add
|
// add
|
||||||
addTypeFlag = commands["add"].BoolP(
|
addTypeFlag = commands["add"].BoolP(
|
||||||
"watch", "w", // long and shorthand flag
|
"watch", "w",
|
||||||
false, // default
|
false,
|
||||||
`Watch a page instead of adding it as a feed.`,
|
`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.`,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user