add command-line wrapper
This commit is contained in:
parent
4c9a7e110b
commit
917a48e703
1 changed files with 20 additions and 0 deletions
20
tools/ubuntu_package_puller/ubuntu-package-puller.py
Executable file
20
tools/ubuntu_package_puller/ubuntu-package-puller.py
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
import distro_source_package_version_history as p
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Pull package versions from the Ubuntu archive.')
|
||||||
|
parser.add_argument('--source-package-name', required=True, help='Name of the source package')
|
||||||
|
parser.add_argument('--distro-version', required=True, help='Version of the distribution')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
package_name = args.source_package_name
|
||||||
|
distro_version = args.distro_version
|
||||||
|
results = p.UbuntuPackageHistory(source_package_name=package_name, distro_version=distro_version)
|
||||||
|
response = results.source_package_version_history()
|
||||||
|
print(json.dumps(response, indent=4))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Add table
Reference in a new issue