This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function main() { | |
local JQ_PREFIX="${JQ_PREFIX:-"$HOME/.local"}" | |
local JQ_BIN="${JQ_BIN:-"$JQ_PREFIX/bin/jq"}" | |
local JQ_LIB="${JQ_LIB:-"$JQ_PREFIX/lib/jq"}" | |
local JQ_MODULE_INCLUDES="" | |
for module in "$JQ_LIB"/*.jq; do | |
JQ_MODULE_INCLUDES="$JQ_MODULE_INCLUDES include "'"'"$(basename "$module" | sed -E 's/\.jq$//g')"'";' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Works both inside of a function as shown here and outside of a function for script arguments | |
main() { | |
POSITIONAL_ARGS="" | |
while (( "$#" )); do | |
case "$1" in | |
-b|--boolean-flag) | |
BOOLEAN_FLAG=1 |