From: Brendan Hansen Date: Sun, 22 May 2022 21:03:36 +0000 (-0500) Subject: added list-versions command to onyx-pkg X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=280a16b0d839ea2ea05f4eb6a9ee6576deda215f;p=onyx.git added list-versions command to onyx-pkg --- 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 {