update cli docs and fix cli scripts with new syntax
This commit is contained in:
16
search.ce
16
search.ce
@@ -8,7 +8,6 @@ if (length(args) < 1) {
|
||||
log.console("Usage: cell search <query>")
|
||||
log.console("Searches for packages, actors, or modules matching the query.")
|
||||
$stop()
|
||||
return
|
||||
}
|
||||
|
||||
var query = args[0]
|
||||
@@ -24,25 +23,26 @@ arrfor(packages, function(package_name) {
|
||||
if (search(package_name, query) != null) {
|
||||
push(found_packages, package_name)
|
||||
}
|
||||
|
||||
|
||||
// Search modules and actors within the package
|
||||
try {
|
||||
var _search = function() {
|
||||
var modules = pkg.list_modules(package_name)
|
||||
arrfor(modules, function(mod) {
|
||||
if (search(mod, query) != null) {
|
||||
push(found_modules, package_name + ':' + mod)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
var actors = pkg.list_programs(package_name)
|
||||
arrfor(actors, function(actor) {
|
||||
if (search(actor, query) != null) {
|
||||
push(found_actors, package_name + ':' + actor)
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
} disruption {
|
||||
// Skip packages that can't be read
|
||||
}
|
||||
_search()
|
||||
})
|
||||
|
||||
// Print results
|
||||
@@ -53,7 +53,7 @@ if (total == 0) {
|
||||
} else {
|
||||
log.console("Found " + text(total) + " result(s) for '" + query + "':")
|
||||
log.console("")
|
||||
|
||||
|
||||
if (length(found_packages) > 0) {
|
||||
log.console("Packages:")
|
||||
arrfor(found_packages, function(p) {
|
||||
@@ -61,7 +61,7 @@ if (total == 0) {
|
||||
})
|
||||
log.console("")
|
||||
}
|
||||
|
||||
|
||||
if (length(found_modules) > 0) {
|
||||
log.console("Modules:")
|
||||
arrfor(found_modules, function(m) {
|
||||
@@ -69,7 +69,7 @@ if (total == 0) {
|
||||
})
|
||||
log.console("")
|
||||
}
|
||||
|
||||
|
||||
if (length(found_actors) > 0) {
|
||||
log.console("Actors:")
|
||||
arrfor(found_actors, function(a) {
|
||||
|
||||
Reference in New Issue
Block a user