ddionrails / collect_stata

Accumulate data from stata files and write it into an open format
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

main() is not called with arguments and does not need arguments. #24

Closed hansendx closed 5 years ago

hansendx commented 5 years ago

Try running

collect_stata

without arguments.

Maybe adding this before args = parser.parse_args() helps?

if args is None:
    parser.print_help()
    sys.exit(1)

main() is not called with arguments and does not need arguments. try

def main():
    """The main routine."""
    parser = argparse.ArgumentParser(description="Get input and output information")
    parser.add_argument("-i", "--input", help="get input path")
    parser.add_argument("-o", "--output", help="get output path")

    if len(sys.argv) == 1:
        parser.print_help()
        sys.exit(1)

Also see my other comment. Check if the arguments make sense and give feedback accordingly.

_Originally posted by @hansendx in https://github.com/ddionrails/collect_stata/pull/11#issuecomment-521154848_