def stop_after(space_number):
 def _outer_wrapper(wrapped_function):
  @wraps(wrapped_function)
  def _wrapper(self, *args, **kwargs):
   try:
    if (args[1].count(' ') == space_number):
     return []
   except Exception as err:
    print_info(err)
   return wrapped_function(self, *args, **kwargs)
  return _wrapper
 return _outer_wrapper

def stop_after ( space_number ) : def _outer_wrapper ( wrapped_function ) : @ wraps ( wrapped_function ) def _wrapper ( self , * args , ** kwargs ) : try : if ( args [ 1 ] . count ( ' ' ) == space_number ) : return [ ] except Exception as err : print_info ( err ) return wrapped_function ( self , * args , ** kwargs ) return _wrapper return _outer_wrapper
decorator that determine when to stop tab-completion decorator that tells command specific complete function when to stop tab-completion .