diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-01-16 20:57:25 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-01-16 20:57:25 +0200 |
commit | 47f3be0b887d387814bbfd870381164bf4162082 (patch) | |
tree | 7c106200002eb32ac22ee663a907cbfe64d479b0 /example.py | |
parent | 4a824f3dfde28aaadcd8b35b1cb2d69cda7eff1d (diff) | |
download | cliapp-47f3be0b887d387814bbfd870381164bf4162082.tar.gz |
Update example.py to use current API.
Diffstat (limited to 'example.py')
-rw-r--r-- | example.py | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -22,11 +22,10 @@ class ExampleApp(cliapp.Application): '''A little fgrep-like tool.''' def add_options(self): - self.add_string_setting('pattern', '-e', action='store', - help='the pattern to search for') + self.add_string_setting(['pattern', 'e'], 'the pattern to search for') def process_input_line(self, name, line): - if self.options.pattern in line: + if self['pattern'] in line: print line, |