diff --git a/console.py b/console.py index a9ec0a1..9d93ca6 100755 --- a/console.py +++ b/console.py @@ -225,6 +225,24 @@ def do_update(self, line): setattr(obj, attr_name, attr_value) storage.save() + def default(self, line): + """Retrieves all instances of a class + Usage: .all() + Args: + : The class name + all(): the method + Returns: + None + """ + args = line.split('.') + + cls_name = args[0] + cls_method = args[1] + + if cls_name in self.__classes: + if cls_method == "all()": + self.do_all(cls_name) + def postcmd(self, stop, line): """Program exit cleanly in response to the quit command """