feat: added optional profiling
This commit is contained in:
@@ -2,10 +2,8 @@ package config
|
||||
|
||||
// Arguments given to program.
|
||||
type Config struct {
|
||||
// The source code given to the program.
|
||||
Source Source
|
||||
// Whether or not to print debug logs.
|
||||
Verbose bool
|
||||
// Whether or not to print an explanation of the reduction.
|
||||
Explanation bool
|
||||
Source Source // The source code given to the program.
|
||||
Verbose bool // Whether or not to print debug logs.
|
||||
Explanation bool // Whether or not to print an explanation of the reduction.
|
||||
Profile string // If not nil, print a CPU profile during execution.
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ func FromArgs() (*Config, error) {
|
||||
// Parse flags.
|
||||
verbose := flag.Bool("v", false, "Verbosity. If set, the program will print logs.")
|
||||
explanation := flag.Bool("x", false, "Explanation. Whether or not to show all reduction steps.")
|
||||
profile := flag.String("p", "", "CPU profiling. If set, the program will run a performance profile during execution.")
|
||||
flag.Parse()
|
||||
|
||||
// Parse non-flag arguments.
|
||||
@@ -31,5 +32,6 @@ func FromArgs() (*Config, error) {
|
||||
Source: source,
|
||||
Verbose: *verbose,
|
||||
Explanation: *explanation,
|
||||
Profile: *profile,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user