-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_bashly.sh
More file actions
32 lines (26 loc) · 902 Bytes
/
Copy pathbase_bashly.sh
File metadata and controls
32 lines (26 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# shellcheck shell=bash
# Bashly adapter boundary for base-bash-libs v2.
#
# Bashly-generated code remains the CLI presentation/build layer. This adapter
# owns only the handoff to the Base Bash initialization and CLI contracts; it
# does not install Bashly, parse generated globals, or add a runtime dependency.
base_bashly_init() {
local argv_variable="$1"
local source_path="${BASE_BASHLY_SOURCE:-${BASH_SOURCE[1]}}"
shift
[[ "$argv_variable" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]] || return 2
base_init "$argv_variable" --source "$source_path" -- "$@"
}
base_bashly_run() {
local model="$1"
shift
[[ "$model" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]] || return 2
[[ "${1-}" == -- ]] && shift
base_cli_run "$model" -- "$@"
}
base_bashly_status() {
local model="$1"
shift
[[ "$model" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]] || return 2
base_cli_help "$model" "$@"
}