diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7a33bbc..3429bdd 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,3 +1,16 @@ +## 6.2.0 + +* new commands eval and r-eval to quickly test a function without having to create a mulle-bashfunctions script +* new commnads embed-booter and extract-booter to just add zsh/bash booting functionality to anotherwise non mulle-bashfunctions script +* somewhat improved tracing speed +* new function `r_smart_file_downcase_identifier` for C header shields for example e.g. #ifndef `foo_h__` +* bugfix for termux (android) +* improved mulle-bashfunctions embedding (and update/removal) to create standalone scripts that don't need mulle-bashfunctions installed +* fix `r_extensionless_filename` +* add --silent-but-warn flag as a `MULLE_FLAG_LOG_TERSE` option +* add `shell_is_builtin_command` function + + ## 6.1.0 * somewhat improved tracing speed diff --git a/mulle-bash b/mulle-bash index 138c22b..880f0c7 100755 --- a/mulle-bash +++ b/mulle-bash @@ -145,7 +145,7 @@ fi # this is "our" version # the actual loaded version may differ (and will change this variable) # -MULLE_BASHFUNCTIONS_VERSION="6.1.0" +MULLE_BASHFUNCTIONS_VERSION="6.2.0" MULLE_BASHFUNCTIONS_LIBEXEC_DIRNAME="libexec" MULLE_EXECUTABLE="$1" diff --git a/mulle-bashfunctions b/mulle-bashfunctions index c627225..cab0311 100755 --- a/mulle-bashfunctions +++ b/mulle-bashfunctions @@ -58,6 +58,7 @@ Usage: * locate the "mulle-bashfunctions.sh" install path for a desired variant * show documentation for any of the defined functions * list the available libraries, which you can "include" + * run an arbitrary mulle-bashfunction with eval and r-eval Examples: Load "mulle-bashfunctions-all.sh" into the current interactive shell: @@ -68,12 +69,14 @@ Commands: apropos : search for a function by keywords embed : embed mulle-bashfunctions into a script env : environment needed for "mulle-bashfunctions.sh" + eval : evaluate cmd inside of mulle-bashfunctions functions : list defined functions hostname : show system hostname used by mulle-bashfunctions libraries : list available libraries load [variant] : use eval \`mulle-bashfunctions load\` to load man : show documention for function, if available path [variant] : path to "mulle-bashfunctions.sh" + r-eval : evaluate cmd inside of mulle-bashfunctions and print RVAL username : show username used by mulle-bashfunctions uname : show system short name used by mulle-bashfunctions version : print currently used version @@ -698,6 +701,9 @@ Usage: A convenient place to place these marker sis right after the booter (below MULLE_EXECUTABLE_VERSION if that line exists). + Use mulle-bashfunctions boot-embed/boot-extract, if you just want to add + or remove the boot code. + EOF exit 1 } @@ -971,6 +977,10 @@ main() usage ;; + -f|--force) + MULLE_FLAG_MAGNUM_FORCE='YES' + ;; + --version) printf "%s\n" "${MULLE_BASHFUNCTIONS_VERSION}" exit 0 @@ -1015,10 +1025,18 @@ MULLE_HOSTNAME=\"${MULLE_HOSTNAME}\" MULLE_UNAME=\"${MULLE_UNAME}\"" ;; + embed-boot) + mulle_boot_embed "$@" + ;; + embed) mulle_boot_embed "$@" | mulle_bashfunctions_embed "$@" ;; + extract-boot) + mulle_boot_extract "$@" + ;; + extract|unembed) mulle_boot_extract "$@" | mulle_bashfunctions_extract "$@" ;; @@ -1082,6 +1100,35 @@ export MULLE_UNAME ; echo "${MULLE_BASHFUNCTIONS_LIBEXEC_DIR}/mulle-bashfunctions${format}.sh" ;; + # useful for accessing a single function from the library + eval) + include "path" + include "file" + include "case" + include "parallel" + include "sort" + include "url" + include "version" + + "$@" + return $? + ;; + + # useful for accessing a r function from the library + r-eval) + include "path" + include "file" + include "case" + include "parallel" + include "sort" + include "url" + include "version" + + "$@" || return $? + printf "%s\n" "${RVAL}" + return 0 + ;; + shell) printf "%s\n" `ps -h -o cmd -p $$ | awk '{ print $1 }'` ;; diff --git a/src/mulle-case.sh b/src/mulle-case.sh index eb42155..2a5ad16 100644 --- a/src/mulle-case.sh +++ b/src/mulle-case.sh @@ -246,6 +246,13 @@ function r_smart_file_downcase_identifier() r_de_camel_case_identifier "$s" r_lowercase "${RVAL}" + + # this to have _MulleFoo not produce __mulle_foo but _mulle_foo + case "${s}" in + +(_)[A-Z]*) + RVAL="${RVAL#_}" + ;; + esac }