Skip to content

Commit 9259510

Browse files
committed
docs: clarify usage examples
1 parent 800965f commit 9259510

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update the README usage section to mention --format option for the native recorder (json or binary) and use of -- to separate tracer options from program arguments, showing example invocations with these options

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,28 @@ recorder.flush_trace(Dir.pwd)
3636
you can currently use it directly with
3737

3838
```bash
39-
ruby gems/codetracer-pure-ruby-recorder/bin/codetracer-pure-ruby-recorder [--out-dir DIR] <path to ruby file>
39+
ruby gems/codetracer-pure-ruby-recorder/bin/codetracer-pure-ruby-recorder [--out-dir DIR] <path to ruby file> [-- <program args>]
4040
# produces several trace json files in DIR,
4141
# or in `$CODETRACER_RUBY_RECORDER_OUT_DIR` if DIR is not provided.
4242
# Defaults to the current directory.
43+
# Use `--` to stop option parsing and pass arguments to the program.
4344
# Pass --help to list all options.
4445
```
4546

4647
You can also invoke a lightweight CLI that loads the native tracer extension
4748
directly:
4849

4950
```bash
50-
ruby gems/codetracer-ruby-recorder/bin/codetracer-ruby-recorder [--out-dir DIR] <path to ruby file>
51+
ruby gems/codetracer-ruby-recorder/bin/codetracer-ruby-recorder [--out-dir DIR] [--format json|binary] <path to ruby file> [-- <program args>]
5152
# Uses DIR or `$CODETRACER_RUBY_RECORDER_OUT_DIR` to choose where traces are saved.
53+
# `--format` selects the trace format (`json` or `binary`).
54+
# Use `--` to pass arguments to the traced program.
55+
```
56+
57+
Example recording a binary trace while passing arguments to the program:
58+
59+
```bash
60+
ruby gems/codetracer-ruby-recorder/bin/codetracer-ruby-recorder --format=binary --out-dir traces examples/runtime_code_execution.rb -- 2
5261
```
5362

5463
however you probably want to use it in combination with CodeTracer, which would be released soon.

0 commit comments

Comments
 (0)