diff options
author | davidovski <david@davidovski.xyz> | 2022-01-12 18:29:17 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-01-12 18:29:17 +0000 |
commit | d78700abae93c771a49f000b0f2ef4260784076f (patch) | |
tree | f2c11f8bca32ed8d29b1721a4f9e0d190c53d203 /src/verbs/info.py | |
parent | 7cc1490eab3c339bf976437c27ced4b9599e0523 (diff) |
added files command to list all files of a package
extended functionality of the info command to list all installed without argument
Diffstat (limited to 'src/verbs/info.py')
-rw-r--r-- | src/verbs/info.py | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/verbs/info.py b/src/verbs/info.py index 8ce531a..fed9a77 100644 --- a/src/verbs/info.py +++ b/src/verbs/info.py @@ -20,13 +20,7 @@ def get_installed_info(package, config, options): return installed_info - -def info(args, options, config): - if not options["l"]: - sync(args, options, config) - - if len(args) > 0: - for package in args: +def package_info(package, config, options): checksum, sources, repo, size, files = find_package(package, config["repos"], config["dir"]["packages"], config["sources"]) if not checksum is None: @@ -53,9 +47,25 @@ def info(args, options, config): print(colors.CYAN + "\t\tChecksum: " + colors.LIGHT_CYAN + f"{installed_info['CHECKSUM']}") print(colors.CYAN + "\t\tURL: " + colors.LIGHT_CYAN + f"{installed_info['URL']}") print(colors.CYAN + "\t\tValidation Key: " + colors.LIGHT_CYAN + f"{installed_info['KEY']}") - - else: print(colors.RED + f"Package {package} could not be found") + +def info(args, options, config): + if not options["l"]: + sync(args, options, config) + + if len(args) == 0: + installed_path = util.add_path(options["r"], config["dir"]["installed"]) + installed = os.listdir(installed_path) + if len(installed) > 0: + [args.append(i) for i in installed] + else: + print(colors.RED + f"No packages have been specified nor installed") + + for package in args: + package_info(package, config, options) + + + |