#!/bin/bash
# mcsh - Mandolin Creek System Helpers
set -e
source "/home/zwelch/src/mcf/mcsh/install/share/mcsh/mcsh.sh"
######
# CLI
mcsh_shell() { shell_run "$@"; }
mcsh_shell_help() { shell_help; }
######
# Tools
mcsh_tool() { cmd_dispatch "$@"; }
mcsh_tool_usage() {
cat <<USAGE
...
Tool Commands:
list Prints all tools
versions Runs 'version' for each tool
USAGE
}
mcsh_tool_list() { mcsh_tool_list; }
mcsh_tool_versions() { for_each_tool run_tool_version; }
######
# Check
mcsh_check() {
mcsh_shell <<EOF
!true
version
quit
EOF
}
######
# Main
mcsh_desc() { echo "Mandolin Creek SHell utility"; }
mcsh_usage() {
cat <<USAGE
<tool> <cmd> [...]
Commands:
shell Runs the built-in command shell
tool ... Commands for $package_name tools
USAGE
}
mcsh_help() {
mcsh_usage
local apps="${package_apps[*]}"
[ -z "$apps" ] || cat<<HELP
The $script_name tool configures and manages settings that affect
the individual tools included in the $package_name package:
$(echo $apps | fmt --width=68 | sed -e 's,^,\t,')
See '<tool> help' for more information.
HELP
}
mcsh_dispatch() {
if is_tool "$1"; then
run "$@"
else
cmd_dispatch "$@"
fi
}
mcsh_app_run() {
local -a args=( "$@" )
[ "$*" ] || args=( shell )
app_run "${args[@]}"
}
mcsh_app_run "$@"
Generated on Tue Apr 25 21:19:35 PDT 2017 by mcsh i7 v0.18.0.