simonw / symbex

Find the Python code for specified symbols
Apache License 2.0
231 stars 6 forks source link

Running `symbex` with no arguments does nothing but pauses for ages #14

Closed simonw closed 1 year ago

simonw commented 1 year ago

It recursively reads in every Python file it can find, but then scans them for no symbols and hence doesn't produce any output.

It shouldn't do all of that work for nothing.

It should probably display help.

simonw commented 1 year ago

Actually I think the solution is to say that symbols are required unless -s is specified.

simonw commented 1 year ago

Got this working:

 % symbex
Usage: symbex [OPTIONS] [SYMBOLS]...
Try 'symbex --help' for help.

Error: Invalid value: Either provide symbols to search for or use -s/--signatures
simonw commented 1 year ago

I want it to show help instead, this seems unfriendly.

simonw commented 1 year ago

Yes this feels much nicer:

% symbex
Usage: symbex [OPTIONS] [SYMBOLS]...

  Find symbols in Python code and print the code for them.

  Example usage:

      # Search current directory and subdirectories
      symbex my_function MyClass

      # Search using a wildcard
      symbex 'test_*'