From 76edc66eba0516df5b051d0720c295e196b20f25 Mon Sep 17 00:00:00 2001 From: Seth House Date: Mon, 15 Jun 2015 00:45:54 -0600 Subject: [PATCH] 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. --- ok.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/ok.sh b/ok.sh index e97f539..715072b 100755 --- a/ok.sh +++ b/ok.sh @@ -125,8 +125,6 @@ _all_funcs() { } __main() { - # ## Usage - # # Usage: `${NAME} [] (command [, ...])` # # ${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, "[$]{[^}]*}")) {