#NEWLINE# @ click . command ( cls = click . CommandCollection , sources = sources_list , context_settings = CONTEXT_SETTINGS , invoke_without_command = True , no_args_is_help = True ) #NEWLINE# @ click . option ( '-c' , '--configure' , is_flag = True , help = 'configure digital ocean access token' ) #NEWLINE# @ click . version_option ( version = 1.0 , message = 'Digital Ocean command line interface. \n%(prog)s, version %(version)s, by Yogesh panchal, yspanchal@gmail.com' ) #NEWLINE# def docli( configure ) : #NEWLINE# #INDENT# "\n\t'docli' is Digital Ocean command line interfaces\n\n\t# To configure docli\n\t>>> docli --configure\n\n\t# To get list available commands\n\t>>> docli --help\n\n\t# How to generate access token\n\thttps://goo.gl/hPkQG7\n\t" #NEWLINE# if configure : #NEWLINE# #INDENT# file = os . path . expanduser ( '~/.do.cfg' ) #NEWLINE# if ( not os . path . isfile ( file ) ) : #NEWLINE# #INDENT# config_file ( file ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# value = click . prompt ( 'Do you want to reconfigure docli [y/n] ?' , type = str , default = 'n' ) #NEWLINE# if ( value . lower ( ) == 'y' ) : #NEWLINE# #INDENT# reconfigure = True #NEWLINE# config_file ( file , reconfigure ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# click . echo ( ) #NEWLINE# click . echo ( 'done..!!!' )