Skip to content

Commit 998374a

Browse files
authored
Merge pull request #188 from nate-at-gusto/correct-bin-rubocop-opts
Correct parsing of opts for bin/rubocop
2 parents bbf6541 + 9115838 commit 998374a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

bin/stackprof

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ if ARGV.first == "run"
66
ARGV.shift
77
env = {}
88
parser = OptionParser.new(ARGV) do |o|
9-
o.banner = "Usage: stackprof run [--mode|--out|--interval] -- COMMAND"
9+
o.banner = "Usage: stackprof run [--mode=MODE|--out=FILE|--interval=INTERVAL|--format=FORMAT] -- COMMAND"
1010
o.banner = "Usage: stackprof [file.dump]+ [--text|--method=NAME|--callgrind|--graphviz]"
1111

12-
o.on('--mode', 'Mode of sampling: cpu, wall, object, default to wall') do |mode|
12+
o.on('--mode [MODE]', String, 'Mode of sampling: cpu, wall, object, default to wall') do |mode|
1313
env["STACKPROF_MODE"] = mode
1414
end
1515

16-
o.on('--out', 'The target file, which will be overwritten. Defaults to a random temporary file') do |out|
16+
o.on('--out [FILENAME]', String, 'The target file, which will be overwritten. Defaults to a random temporary file') do |out|
1717
env['STACKPROF_OUT'] = out
1818
end
1919

20-
o.on('--interval', 'Mode-relative sample rate') do |interval|
21-
env['STACKPROF_INTERVAL'] = Integer(interval).to_s
20+
o.on('--interval [MILLISECONDS]', Integer, 'Mode-relative sample rate') do |interval|
21+
env['STACKPROF_INTERVAL'] = interval.to_s
2222
end
2323

24-
o.on('--raw', 'collects the extra data required by the --flamegraph and --stackcollapse report types') do
25-
env['STACKPROF_RAW'] = '1'
24+
o.on('--raw', 'collects the extra data required by the --flamegraph and --stackcollapse report types') do |raw|
25+
env['STACKPROF_RAW'] = raw.to_s
2626
end
2727

28-
o.on('--ignore-gc', 'Ignore garbage collection frames') do
29-
env['STACKPROF_IGNORE_GC'] = '1'
28+
o.on('--ignore-gc', 'Ignore garbage collection frames') do |gc|
29+
env['STACKPROF_IGNORE_GC'] = gc.to_s
3030
end
3131
end
3232
parser.parse!

0 commit comments

Comments
 (0)