<s> from __future__ import absolute_import <EOL> import sys <EOL> from . io import prompt , parse_input , output_result <EOL> from . client import Client <EOL> from . args import init_parser <EOL> def main ( ) : <EOL> args = init_parser ( ) . parse_args ( sys . argv [ <NUM_LIT:1> : ] ) <EOL> client = Client ( protocol = args . protocol , <EOL> endpoint = args . endpoint ) <EOL> try : <EOL> while True : <EOL> input_str = prompt ( current_db = client . db_name ) <EOL> if input_str : <EOL> command , args = parse_input ( input_str ) <EOL> if not command == "<STR_LIT>" : <EOL> status , result = client . send_cmd ( client . db_uid , command , args ) <EOL> output_result ( status , result ) <EOL> else : <EOL> client . connect ( * args ) <EOL> except KeyboardInterrupt : <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
