aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2021-03-08 04:08:14 -0700
committerTim Harder <radhermit@gmail.com>2021-03-08 04:08:14 -0700
commitc65ee1c63ac556abd6be16eddc47c27c6b55c680 (patch)
tree1553b82481a9c4390b58c5d250acc6d8d029c94c /examples
parentutil.commandline: drop deprecated main() wrapper (diff)
downloadpkgcore-c65ee1c63ac556abd6be16eddc47c27c6b55c680.tar.gz
pkgcore-c65ee1c63ac556abd6be16eddc47c27c6b55c680.tar.bz2
pkgcore-c65ee1c63ac556abd6be16eddc47c27c6b55c680.zip
examples: replace commandline.main() usage
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 00f39404..4575de34 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 77ed4f5f..51ff4347 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 d859a686..2b3cb2c5 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())