8000 tracer: document how to pass arguments to a spawned target by tubibibo · Pull Request #212 · frida/frida-tools · GitHub
[go: up one dir, main page]

Skip to content
8000

tracer: document how to pass arguments to a spawned target - #212

Merged
oleavr merged 1 commit into
frida:mainfrom
tubibibo:tracer/document-arg-passing
Nov 5, 2026
Merged

oleavr merged 1 commit into
frida:mainfrom
tubibibo:tracer/document-arg-passing

Conversation

@tubibibo
@tubibibo tubibibo commented Nov 5, 2026
Copy link
Copy Markdown
Contributor

frida-trace --help said usage: frida-trace [options] target without saying what a target can be, and gave no hint that extra arguments are passed to the spawned program, or that -- is needed before arguments that start with - (frida-tools#188).

With nargs="*" on the positional, frida-trace -f ./prog arg1 arg2 already forwards arg1 arg2, but frida-trace -f ./prog --flag fails with unrecognized arguments: --flag; -- makes it work. Both cases are now spelled out in the epilog, and the usage line shows that extra arguments are accepted.

usage: frida-trace [options] target [args...]
...
TARGET is a process name, a PID, or the path to a program to spawn. Arguments
after TARGET are passed to the spawned program, so use -- before any of them
that start with -, e.g. frida-trace -f ./prog -i 'open*' -- --flag value

Verified with the same parser shape (-f + nargs="*" positional):

  • -f ./prog -- --flag value -> target ('file', ['./prog']), args ['--flag', 'value']
  • -f ./prog arg1 arg2 -> args ['arg1', 'arg2']
  • -f ./prog --flag -> error: unrecognized arguments: --flag (unchanged)

No behavior changes, help text only; black, isort and pyflakes are clean.

Explain in --help what a target can be, that arguments after it are
passed to the spawned program, and that -- is needed before ones that
start with -.

Fixes frida#188
@oleavr
oleavr force-pushed the tracer/document-arg-passing branch from 5fa511f to c4381d6 Compare November 5, 2026 19:28
@oleavr
oleavr merged commit c4381d6 into frida:main Nov 5, 2026
@oleavr
oleavr commented Nov 5, 2026
Copy link
Copy Markdown
Member

Thanks! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0