#NEWLINE# def _make_command( f , name , attrs , cls ) : #NEWLINE# #INDENT# if isinstance ( f , Command ) : #NEWLINE# #INDENT# raise TypeError ( 'Attempted to convert a callback into a command twice.' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# params = f . __click_params__ #NEWLINE# params . reverse ( ) #NEWLINE# del f . __click_params__ #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# params = [ ] #NEWLINE# #UNINDENT# help = attrs . get ( 'help' ) #NEWLINE# if ( help is None ) : #NEWLINE# #INDENT# help = inspect . getdoc ( f ) #NEWLINE# if isinstance ( help , bytes ) : #NEWLINE# #INDENT# help = help . decode ( 'utf-8' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# help = inspect . cleandoc ( help ) #NEWLINE# #UNINDENT# attrs [ 'help' ] = help #NEWLINE# _check_for_unicode_literals ( ) #NEWLINE# return cls ( name = ( name or f . __name__ . lower ( ) ) , callback = f , params = params , ** attrs )