diff options
author | Tim Harder <radhermit@gmail.com> | 2021-03-08 04:08:14 -0700 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2021-03-08 04:08:14 -0700 |
commit | c65ee1c63ac556abd6be16eddc47c27c6b55c680 (patch) | |
tree | 1553b82481a9c4390b58c5d250acc6d8d029c94c /examples | |
parent | util.commandline: drop deprecated main() wrapper (diff) | |
download | pkgcore-c65ee1c63ac556abd6be16eddc47c27c6b55c680.tar.gz pkgcore-c65ee1c63ac556abd6be16eddc47c27c6b55c680.tar.bz2 pkgcore-c65ee1c63ac556abd6be16eddc47c27c6b55c680.zip |
examples: replace commandline.main() usage
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/changed_use.py | 4 | ||||
-rwxr-xr-x | examples/pkg_info.py | 4 | ||||
-rwxr-xr-x | examples/repo_list.py | 3 |
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()) |