def main(): #create the arg parser, and add the args to parse (just -f for now) parser = argparse.ArgumentParser(description='Checks to see if there are any inconsistencies in the lind filesystem') #optional argument -f parser.add_argument('-f', action='store_true', help='If specified, the program automatically makes changes when it sees errors') args = parser.parse_args() #this flag will be passed through all the recursive calls, so that the program knows to #make changes as it sees errors. true if the -f flag was specified make_changes_flag = False if(args.f): make_changes_flag = True #check if there is existing metadata, if there is none, create a blank one lind_fs_calls.load_fs() loop_through_dir_tree_recursive(0, "", make_changes_flag) #check_paths_correctness() lind_fs_calls.persist_metadata("lind.metadata")
sys.exit(1) #set up the arg parser to parse the args to the program parser = argparse.ArgumentParser(description='Allows the user to manage their lind file systems, and copy files in') parser.add_argument('interactive', metavar='-', nargs='?', type=str, help='If specified, the program runs in interactive mode') parser.add_argument('copy', metavar='cp', nargs='?', type=str, help='Runs just a single copy') args = parser.parse_args() #the main argument is the '-'. If it is specified, the user would like to run in interactive mode if not args.interactive: pass else: #request user input (the command they want to type) input_value = raw_input(lind_fs_calls.fs_calls_context['currentworkingdirectory'] +": ") #loop until the user hits exit, prompting them to enter a command at each iteration while not (input_value == "exit" or input_value == "quit"): parse_input(input_value) input_value = raw_input(lind_fs_calls.fs_calls_context['currentworkingdirectory'] +": ") lind_fs_calls.persist_metadata("lind.metadata") if __name__ == "__main__": main()