mirror of
https://github.com/clearlinux/ok.sh.git
synced 2026-09-01 02:34:44 +00:00
Move headings out of function definitions
A function shouldn't (need to) be aware of where it lives in the heading hierarchy. That should be handled centrally.
This commit is contained in:
@@ -125,8 +125,6 @@ _all_funcs() {
|
||||
}
|
||||
|
||||
__main() {
|
||||
# ## Usage
|
||||
#
|
||||
# Usage: `${NAME} [<flags>] (command [<arg>, <name=value>...])`
|
||||
#
|
||||
# ${NAME} -h # Short, usage help text.
|
||||
@@ -149,14 +147,6 @@ __main() {
|
||||
# -v | Logging output; specify multiple times: info, debug, trace.
|
||||
# -x | Enable xtrace debug logging.
|
||||
# -y | Answer 'yes' to any prompts.
|
||||
#
|
||||
# ## Utility and request/response commands
|
||||
#
|
||||
# ${UTIL_FUNCS}
|
||||
#
|
||||
# ## GitHub commands
|
||||
#
|
||||
# ${GH_FUNCS}
|
||||
|
||||
local cmd ret opt OPTARG OPTIND
|
||||
local quiet=0
|
||||
@@ -273,9 +263,7 @@ _helptext() {
|
||||
# * (stdin)
|
||||
# The text of a function body to parse.
|
||||
|
||||
GH_FUNCS="$(_all_funcs pretty=1 private=0)" \
|
||||
UTIL_FUNCS="$(_all_funcs pretty=1 public=0)" \
|
||||
awk '
|
||||
awk '
|
||||
NR != 1 && /^\s*#/ {
|
||||
line=$0
|
||||
while(match(line, "[$]{[^}]*}")) {
|
||||
|
||||
Reference in New Issue
Block a user