// list modules and actors in a package
// if args[0] is a package alias, list that one
// otherwise, list the local one

var shop = use('internal/shop')
var package = use('package')

var ctx = null
var pkg = args[0] || package.find_package_dir('.')
var modules = package.list_modules(pkg)
var programs = package.list_programs(pkg)
var i = 0

log.console("Modules in " + pkg + ":")
modules = sort(modules)
if (length(modules) == 0) {
  log.console("  (none)")
} else {
  for (i = 0; i < length(modules); i++) {
      log.console("  " + modules[i])
  }
}

log.console("")
log.console("Programs in " + pkg + ":")
programs = sort(programs)
if (length(programs) == 0) {
  log.console("  (none)")
} else {
  for (i = 0; i < length(programs); i++) {
      log.console("  " + programs[i])
  }
}

$stop()
