
import json
import sys

from .visitor import visit_fabfile

def main():
    json.dump(visit_fabfile(), sys.stdout, indent=2 if sys.stdout.isatty() else None)

if __name__ == '__main__':
    main()


import json
import sys

from .visitor import visit_fabfile

def main(args):
    path = None
    if args:
        path = args[0]
    json.dump(visit_fabfile(path), sys.stdout, indent=2 if sys.stdout.isatty() else None)

if __name__ == '__main__':
    main(sys.argv[1:])

Allow passing in a path to a fabfile.
Allow passing in a path to a fabfile.
  
  import json
  import sys
  
  from .visitor import visit_fabfile
  
- def main():
+ def main(args):
+     path = None
+     if args:
+         path = args[0]
-     json.dump(visit_fabfile(), sys.stdout, indent=2 if sys.stdout.isatty() else None)
+     json.dump(visit_fabfile(path), sys.stdout, indent=2 if sys.stdout.isatty() else None)
  
  if __name__ == '__main__':
-     main()
+     main(sys.argv[1:])
  
Allow passing in a path to a fabfile.
## Code Before:

import json
import sys

from .visitor import visit_fabfile

def main():
    json.dump(visit_fabfile(), sys.stdout, indent=2 if sys.stdout.isatty() else None)

if __name__ == '__main__':
    main()

## Instruction:
Allow passing in a path to a fabfile.
## Code After:

import json
import sys

from .visitor import visit_fabfile

def main(args):
    path = None
    if args:
        path = args[0]
    json.dump(visit_fabfile(path), sys.stdout, indent=2 if sys.stdout.isatty() else None)

if __name__ == '__main__':
    main(sys.argv[1:])
