Search as a table, Orbit-only results, and spinner fix #6
+9
-1
@@ -801,7 +801,9 @@ async fn cmd_search(ctx : Ctx, term : String) -> Unit raise OrbitError {
|
|||||||
listed = listed + 1
|
listed = listed + 1
|
||||||
let candidates : Array[String] = []
|
let candidates : Array[String] = []
|
||||||
for r in lines(out) {
|
for r in lines(out) {
|
||||||
if contains_str(r, term) {
|
// A name with "/" is a nested channel namespace (e.g. example/greet under
|
||||||
|
// main), not a package name that `orbit install` could use.
|
||||||
|
if valid_name(r) && contains_str(r, term) {
|
||||||
candidates.push(r)
|
candidates.push(r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -879,6 +881,12 @@ test "search info comes from OCI annotations" {
|
|||||||
assert_eq(bare.description, "")
|
assert_eq(bare.description, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///|
|
||||||
|
test "search skips nested channel namespaces" {
|
||||||
|
assert_true(valid_name("greet"))
|
||||||
|
assert_true(!valid_name("example/greet"))
|
||||||
|
}
|
||||||
|
|
||||||
///|
|
///|
|
||||||
test "table columns line up" {
|
test "table columns line up" {
|
||||||
assert_eq(pad_right("ab", 4), "ab ")
|
assert_eq(pad_right("ab", 4), "ab ")
|
||||||
|
|||||||
Reference in new issue
Block a user