-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored cli, added rule edit commands, fixes
fixes #3
- Loading branch information
Showing
13 changed files
with
551 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package cli_utils | ||
|
||
import ( | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
var rulePath string | ||
var logDir string | ||
var verbose bool | ||
var par int | ||
var buffer int | ||
|
||
var RulesPathFlag = &cli.StringFlag{ | ||
Name: "rules", | ||
Aliases: []string{"r"}, | ||
Value: "~/.heptapod/rules", | ||
Usage: "the directory containing rule yamls", | ||
Destination: &rulePath, | ||
} | ||
|
||
var LogDirFlag = &cli.StringFlag{ | ||
Name: "logDir", | ||
Aliases: []string{"ld"}, | ||
Value: "~/.heptapod/logs", | ||
Usage: "the directory where excluded dirs logged for reliable prune/uninstall", | ||
Destination: &logDir, | ||
} | ||
|
||
var VerboseFlag = &cli.BoolFlag{ | ||
Name: "verbose", | ||
Aliases: []string{"v"}, | ||
Value: false, | ||
Usage: "prints out performance logs (and other logs in general)", | ||
Destination: &verbose, | ||
} | ||
|
||
var ParallelismFlag = &cli.IntFlag{ | ||
Name: "parallelism", | ||
Aliases: []string{"p", "par"}, | ||
Value: 4, | ||
Usage: "number of workers where the code is multithreaded", | ||
Destination: &par, | ||
} | ||
|
||
var BufferSizeFlag = &cli.IntFlag{ | ||
Name: "bufferSize", | ||
Aliases: []string{"b", "buffer"}, | ||
Value: 2048, | ||
Usage: "number of elements buffered, can cause deadlocks", | ||
Destination: &buffer, | ||
} |
Oops, something went wrong.