#NEWLINE# def parse_arguments( ) : #NEWLINE# #INDENT# '\n    Gather command-line arguments.\n    ' #NEWLINE# parser = argparse . ArgumentParser ( prog = 'swhashcomp' , description = ( ( 'compare the md5sum of a local file or hash with the hash ' + 'of a swift object folder after a data migration ' ) + '' ) ) #NEWLINE# parser . add_argument ( '--locfile' , '-f' , dest = 'locfile' , action = 'store' , help = 'a local or networked file to compare' , default = '' ) #NEWLINE# parser . add_argument ( '--container' , '-c' , dest = 'container' , action = 'store' , help = 'a container in the swift object store' , default = '' ) #NEWLINE# parser . add_argument ( '--obj' , '-o' , dest = 'obj' , action = 'store' , help = 'an object in a swift container' , default = None ) #NEWLINE# parser . add_argument ( '--authtoken' , '-a' , dest = 'authtoken' , action = 'store' , help = 'a swift authentication token (required when storage-url is used)' , default = None ) #NEWLINE# parser . add_argument ( '--storage-url' , '-s' , dest = 'storageurl' , action = 'store' , help = 'a swift storage url (required when authtoken is used)' , default = None ) #NEWLINE# args = parser . parse_args ( ) #NEWLINE# if ( not parser . locfile ) : #NEWLINE# #INDENT# parser . error ( 'required option --locfile not given !' ) #NEWLINE# #UNINDENT# if ( not args . container ) : #NEWLINE# #INDENT# parser . error ( 'required option --container not given !' ) #NEWLINE# #UNINDENT# if ( not args . obj ) : #NEWLINE# #INDENT# parser . error ( 'required option --obj not given !' ) #NEWLINE# #UNINDENT# return args