Skip to content

Commit

Permalink
--replace example in symbex --help, refs #31
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jun 29, 2023
1 parent 3f474c5 commit ccc55da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ Usage: symbex [OPTIONS] [SYMBOLS]...
# Count the number of --async functions in the project
symbex --async --count
# Replace my_function with a new implementation:
echo "def my_function(a, b):
# This is a replacement implementation
return a + b + 3
" | symbex my_function --replace
Options:
--version Show the version and exit.
-f, --file FILE Files to search
Expand Down
7 changes: 7 additions & 0 deletions symbex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ def cli(
\b
# Count the number of --async functions in the project
symbex --async --count
\b
# Replace my_function with a new implementation:
echo "def my_function(a, b):
# This is a replacement implementation
return a + b + 3
" | symbex my_function --replace
"""
if modules:
module_dirs = []
Expand Down

0 comments on commit ccc55da

Please sign in to comment.