Add --version
Rolling Release / build (push) Successful in 1m47s
Rolling Release / publish (push) Successful in 8s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Opus 5.5 committed 2026-12-01 04:58:11 -08:00
1 parent dfda555f9b
commit ec0b6eaa0f
2 files changed
+14

No files matched your search

+6
View File
@@ -1,5 +1,9 @@
// orbit: a package manager whose repository is any OCI registry. // orbit: a package manager whose repository is any OCI registry.
///|
/// Orbit's version. A test keeps it equal to the one in moon.mod.
let orbit_version : String = "0.1.0"
///| ///|
let usage : String = let usage : String =
#|orbit - packages as OCI artifacts #|orbit - packages as OCI artifacts
@@ -42,6 +46,7 @@ let usage : String =
#| orbit env [-g] print the PATH line for your shell #| orbit env [-g] print the PATH line for your shell
#| #|
#|flags: -g, --global --manifest-path <path> --locked --frozen #|flags: -g, --global --manifest-path <path> --locked --frozen
#| -h, --help -V, --version
#|constraints: 1.2.3 =1.2.3 ==1.2.3 1.2.* ^1.2.0 ~1.2.0 >=1.2 <2.0 !=1.3.0 * #|constraints: 1.2.3 =1.2.3 ==1.2.3 1.2.* ^1.2.0 ~1.2.0 >=1.2 <2.0 !=1.3.0 *
#| (comma-separated clauses are ANDed, e.g. ">=1.2.0, <2.0.0") #| (comma-separated clauses are ANDed, e.g. ">=1.2.0, <2.0.0")
#|config: <orbit root>/config.toml #|config: <orbit root>/config.toml
@@ -189,6 +194,7 @@ async fn dispatch(args : Array[String]) -> Unit raise OrbitError {
} }
match cmd { match cmd {
"help" | "-h" | "--help" => println(usage) "help" | "-h" | "--help" => println(usage)
"-V" | "--version" => println("orbit \{orbit_version}")
"new" => { "new" => {
if force_global { if force_global {
raise OrbitError("--global cannot be used with `orbit new`") raise OrbitError("--global cannot be used with `orbit new`")
+8
View File
@@ -1077,3 +1077,11 @@ async test "large layers upload in chunks, or whole where that is unsupported" {
} }
assert_true(other) assert_true(other)
} }
///|
async test "orbit --version matches moon.mod" {
// Tests may run from the module root or the package directory.
let path = if exists("moon.mod") { "moon.mod" } else { "../../moon.mod" }
let manifest = @fs.read_file(path).text()
assert_true(contains_str(manifest, "\nversion = \"\{orbit_version}\"\n"))
}