#NEWLINE# def main( ) : #NEWLINE# #INDENT# parser = argparse . ArgumentParser ( ) #NEWLINE# parser . add_argument ( '-p' , '--profile' , help = 'The profile name to use when starting the AWS Shell.' ) #NEWLINE# args = parser . parse_args ( ) #NEWLINE# indexer = completion . CompletionIndex ( ) #NEWLINE# try : #NEWLINE# #INDENT# index_str = indexer . load_index ( utils . AWSCLI_VERSION ) #NEWLINE# index_data = json . loads ( index_str ) #NEWLINE# #UNINDENT# except completion . IndexLoadError : #NEWLINE# #INDENT# print ( 'First run, creating autocomplete index...' ) #NEWLINE# from awsshell.makeindex import write_index #NEWLINE# index_file = indexer . _filename_for_version ( utils . AWSCLI_VERSION ) #NEWLINE# write_index ( index_file ) #NEWLINE# index_str = indexer . load_index ( utils . AWSCLI_VERSION ) #NEWLINE# index_data = json . loads ( index_str ) #NEWLINE# #UNINDENT# doc_index_file = determine_doc_index_filename ( ) #NEWLINE# from awsshell.makeindex import write_doc_index #NEWLINE# doc_data = docs . load_lazy_doc_index ( doc_index_file ) #NEWLINE# try : #NEWLINE# #INDENT# docs . load_doc_db ( doc_index_file ) [ '__complete__' ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# print ( 'Creating doc index in the background. It will be a few minutes before all documentation is available.' ) #NEWLINE# t = threading . Thread ( target = write_doc_index , args = ( doc_index_file , ) ) #NEWLINE# t . daemon = True #NEWLINE# t . start ( ) #NEWLINE# #UNINDENT# model_completer = autocomplete . AWSCLIModelCompleter ( completer ) #NEWLINE# completer = shellcomplete . AWSShellCompleter ( model_completer ) #NEWLINE# shell = app . create_aws_shell ( completer , model_completer , doc_data ) #NEWLINE# if args . profile : #NEWLINE# #INDENT# shell . profile = args . profile #NEWLINE# #UNINDENT# shell . run ( )