aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/changed_use.py4
-rwxr-xr-xexamples/pkg_info.py4
-rwxr-xr-xexamples/repo_list.py3
3 files changed, 8 insertions, 3 deletions
diff --git a/examples/changed_use.py b/examples/changed_use.py
index 00f394048..4575de343 100755
--- a/examples/changed_use.py
+++ b/examples/changed_use.py
@@ -66,5 +66,7 @@ def main(options, out, err):
if options.verbosity > 0:
out.write("%s is the same as it was before" % current.cpvstr)
+
if __name__ == '__main__':
- commandline.main(argparser)
+ tool = commandline.Tool(argparser)
+ sys.exit(tool())
diff --git a/examples/pkg_info.py b/examples/pkg_info.py
index 77ed4f5fd..51ff4347e 100755
--- a/examples/pkg_info.py
+++ b/examples/pkg_info.py
@@ -49,5 +49,7 @@ def main(options, out, err):
(item.title(), 's'[len(values) == 1:], ', '.join(str(x) for x in values)))
out.write()
+
if __name__ == '__main__':
- commandline.main(argparser)
+ tool = commandline.Tool(argparser)
+ sys.exit(tool())
diff --git a/examples/repo_list.py b/examples/repo_list.py
index d859a6869..2b3cb2c51 100755
--- a/examples/repo_list.py
+++ b/examples/repo_list.py
@@ -47,4 +47,5 @@ def main(options, out, err):
if __name__ == '__main__':
- commandline.main(argparser)
+ tool = commandline.Tool(argparser)
+ sys.exit(tool())