| 81 | section_aliases[alias] = section_aliases[alias].strip() |
| 82 | |
| 83 | def get_aliases(self, command=None): |
| 84 | # To preserve existing behavior, get_alises() with no args |
| 85 | # will return the top level aliases, i.e `[topleve]`. |
| 86 | # However, you can now get aliases for a specific section by |
| 87 | # providing a command key which is a tuple of the command |
| 88 | # lineage, i.e. `('ec2', 'wait',)`. |
| 89 | if command is None: |
| 90 | key = 'toplevel' |
| 91 | else: |
| 92 | key = ('command',) + tuple(command) |
| 93 | if self._aliases is None: |
| 94 | self._build_aliases() |
| 95 | return self._aliases.get(key, {}) |
| 96 | |
| 97 | |
| 98 | class BaseAliasCommandInjector: |