opts, args = gnu_getopt(args, 'p:', ['pool=']) except getopt.GetoptError, e: usage(e) if not args: usage() pool_path = None for opt, val in opts: if opt in ('-p', '--pool'): pool_path = val if pool_path is None: pool_path = os.environ.get('FAB_POOL_PATH') plan = Plan(pool_path=pool_path) for arg in args: if arg == "-" or exists(arg): plan |= Plan.init_from_file(arg, cpp_opts, pool_path) else: plan.add(arg) dctrls = plan.dctrls() print generate_index(dctrls) if __name__=="__main__": main()
try: opts, args = gnu_getopt(args, 'p:', ['pool=']) except getopt.GetoptError, e: usage(e) if not args: usage() pool_path = None for opt, val in opts: if opt in ('-p', '--pool'): pool_path = val if pool_path is None: pool_path = os.environ.get('FAB_POOL_PATH') plan = Plan(pool_path=pool_path) for arg in args: if arg == "-" or exists(arg): plan |= Plan.init_from_file(arg, cpp_opts, pool_path) else: plan.add(arg) dctrls = plan.dctrls() print generate_index(dctrls) if __name__ == "__main__": main()