Revision 2d1f5058 kamaki/cli/history.py
b/kamaki/cli/history.py | ||
---|---|---|
37 | 37 |
|
38 | 38 |
|
39 | 39 |
class History(object): |
40 |
def __init__(self, filepath): |
|
40 |
def __init__(self, filepath, token=None):
|
|
41 | 41 |
self.filepath = filepath |
42 |
self.token = token |
|
42 | 43 |
|
43 | 44 |
@classmethod |
44 | 45 |
def _match(self, line, match_terms): |
... | ... | |
58 | 59 |
return result[- limit:] |
59 | 60 |
|
60 | 61 |
def add(self, line): |
62 |
line = line.replace(self.token, '...') if self.token else line |
|
61 | 63 |
with open(self.filepath, 'a+') as f: |
62 | 64 |
f.write(line + '\n') |
63 | 65 |
|
Also available in: Unified diff