diff --git a/README.rst b/README.rst index 44816f0..0f81e38 100644 --- a/README.rst +++ b/README.rst @@ -11,8 +11,9 @@ Support Commands: - ls:: Usage: ls {groups | records | `group_name` | `group_id`} - selected args: - - `group`: literal key word, show all the groups + selected args:: + - single `ls` command: default to show all groups + - `groups`: literal key word, show all the groups - `records`: literal key word, show all the records - group_name: group name, show all the records in the specific group - group_id: group id, show all the records in the specific group diff --git a/papyrus.py b/papyrus.py index 77af1b7..d9cabb0 100644 --- a/papyrus.py +++ b/papyrus.py @@ -38,7 +38,7 @@ def __init__(self): self.cipher = '' self.data = None # self._records is a proxy structure mapping to the records of - # self.data and is use for better contrive records. + # self.data and is use for better retrieve records. self._records = defaultdict(dict) def initialize(self, cipher, filepath='records.dat'): @@ -327,13 +327,19 @@ def do_ls(self, line): Usage: ls {groups | records | `group_name` | `group_id`} selected args:: - - `group`: literal key word, show all the groups + - single `ls` command: default to show all groups + - `groups`: literal key word, show all the groups - `records`: literal key word, show all the records - group_name: group name, show all the records in the specific group - group_id: group id, show all the records in the specific group List all the groups or records existing in the current program. """ + # single `ls` command, default to show all groups + if line == '': + self._ls_case_groups('groups') + return + args = self._validate_line(line, lengths=(1, 2), cmd='ls') target = args[0] if target.isdigit():