Skip to content

Commit 3e36d37

Browse files
GH-142646: Update Tachyon to use backtick formatting in CLI help (#142647)
1 parent c90863a commit 3e36d37

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

Lib/profiling/sampling/cli.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,20 @@ class CustomFormatter(
4141

4242
_HELP_DESCRIPTION = """Sample a process's stack frames and generate profiling data.
4343
44-
Commands:
45-
run Run and profile a script or module
46-
attach Attach to and profile a running process
47-
4844
Examples:
4945
# Run and profile a script
50-
python -m profiling.sampling run script.py arg1 arg2
46+
`python -m profiling.sampling run script.py arg1 arg2`
5147
5248
# Attach to a running process
53-
python -m profiling.sampling attach 1234
49+
`python -m profiling.sampling attach 1234`
5450
5551
# Live interactive mode for a script
56-
python -m profiling.sampling run --live script.py
52+
`python -m profiling.sampling run --live script.py`
5753
5854
# Live interactive mode for a running process
59-
python -m profiling.sampling attach --live 1234
55+
`python -m profiling.sampling attach --live 1234`
6056
61-
Use 'python -m profiling.sampling <command> --help' for command-specific help."""
57+
Use `python -m profiling.sampling <command> --help` for command-specific help."""
6258

6359

6460
# Constants for socket synchronization
@@ -506,19 +502,19 @@ def main():
506502
507503
Examples:
508504
# Run and profile a module
509-
python -m profiling.sampling run -m mymodule arg1 arg2
505+
`python -m profiling.sampling run -m mymodule arg1 arg2`
510506
511507
# Generate flamegraph from a script
512-
python -m profiling.sampling run --flamegraph -o output.html script.py
508+
`python -m profiling.sampling run --flamegraph -o output.html script.py`
513509
514510
# Profile with custom interval and duration
515-
python -m profiling.sampling run -i 50 -d 30 script.py
511+
`python -m profiling.sampling run -i 50 -d 30 script.py`
516512
517513
# Save collapsed stacks to file
518-
python -m profiling.sampling run --collapsed -o stacks.txt script.py
514+
`python -m profiling.sampling run --collapsed -o stacks.txt script.py`
519515
520516
# Live interactive mode for a script
521-
python -m profiling.sampling run --live script.py""",
517+
`python -m profiling.sampling run --live script.py`""",
522518
)
523519
run_parser.add_argument(
524520
"-m",
@@ -554,10 +550,10 @@ def main():
554550
555551
Examples:
556552
# Profile all threads, sort by total time
557-
python -m profiling.sampling attach -a --sort tottime 1234
553+
`python -m profiling.sampling attach -a --sort tottime 1234`
558554
559555
# Live interactive mode for a running process
560-
python -m profiling.sampling attach --live 1234""",
556+
`python -m profiling.sampling attach --live 1234`""",
561557
)
562558
attach_parser.add_argument(
563559
"pid",

0 commit comments

Comments
 (0)