From 280a16b0d839ea2ea05f4eb6a9ee6576deda215f Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sun, 22 May 2022 16:03:36 -0500 Subject: [PATCH] added list-versions command to onyx-pkg --- scripts/onyx-pkg.onyx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/onyx-pkg.onyx b/scripts/onyx-pkg.onyx index 4ef06eb8..8c7183e2 100644 --- a/scripts/onyx-pkg.onyx +++ b/scripts/onyx-pkg.onyx @@ -396,6 +396,22 @@ run_publish_command :: (args: [] cstr) { } } +#tag Command.{ "list-versions", "List all installable versions of a remote package.", "[package-url]", require_config_file=false } +run_list_versions :: (args: [] cstr) { + if args.count < 1 { + return; + } + + pack := string.as_str(args[0]); + + versions := Git.get_available_versions(pack); + defer delete(^versions); + + for versions { + printf("- {}\n", it); + } +} + #local { #if runtime.compiler_os == .Linux { -- 2.25.1