summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-01-16 20:57:25 +0200
committerLars Wirzenius <liw@liw.fi>2011-01-16 20:57:25 +0200
commit47f3be0b887d387814bbfd870381164bf4162082 (patch)
tree7c106200002eb32ac22ee663a907cbfe64d479b0 /example.py
parent4a824f3dfde28aaadcd8b35b1cb2d69cda7eff1d (diff)
downloadcliapp-47f3be0b887d387814bbfd870381164bf4162082.tar.gz
Update example.py to use current API.
Diffstat (limited to 'example.py')
-rw-r--r--example.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/example.py b/example.py
index 64434ac..e1ffc8f 100644
--- a/example.py
+++ b/example.py
@@ -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,