Merge branch 'master' of github.com:trailofbits/slither

pull/55/head
Josselin 6 years ago
commit 68f32a980c
  1. 2
      README.md
  2. 6
      slither/__main__.py

@ -17,7 +17,7 @@ Slither is a Solidity static analysis framework written in Python 3. It runs a s
## Usage
```
$ slither tests/uninitialized.sol
$ slither tests/uninitialized.sol # argument can be file, folder or glob, be sure to quote the argument when using a glob
[..]
INFO:Detectors:Uninitialized state variables in tests/uninitialized.sol, Contract: Uninitialized, Vars: destination, Used in ['transfer']
[..]

@ -189,12 +189,16 @@ def main_impl(all_detector_classes, all_printer_classes):
try:
filename = args.filename
globbed_filenames = glob.glob(filename, recursive=True)
if os.path.isfile(filename):
(results, number_contracts) = process(filename, args, detector_classes, printer_classes)
elif os.path.isdir(filename):
elif os.path.isdir(filename) or len(globbed_filenames) > 0:
extension = "*.sol" if not args.solc_ast else "*.json"
filenames = glob.glob(os.path.join(filename, extension))
if len(filenames) == 0:
filenames = globbed_filenames
number_contracts = 0
results = []
for filename in filenames:

Loading…
Cancel
Save