diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..8b191e6 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = sublime* +ignore-words-list = bu diff --git a/CHANGELOG.md b/CHANGELOG.md index e87a77e..8f9dc79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,10 +27,11 @@ v0.4.12 - 2022-05-23 - Fix completions error with configs that do not have subcommands + v0.4.11 - 2022-05-12 ---------------------------------------- -- Genearte with bashly 0.8.0 +- Generate with bashly 0.8.0 v0.4.10 - 2022-03-28 diff --git a/alf b/alf index 9d1c30a..f5e8514 100755 --- a/alf +++ b/alf @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# This script was generated by bashly 1.1.0 (https://bashly.dannyb.co) +# This script was generated by bashly 1.1.7 (https://bashly.dannyb.co) # Modifying it manually is not recommended # :wrapper.bash3_bouncer @@ -431,7 +431,9 @@ inspect_args() { if ((${#args[@]})); then readarray -t sorted_keys < <(printf '%s\n' "${!args[@]}" | sort) echo args: - for k in "${sorted_keys[@]}"; do echo "- \${args[$k]} = ${args[$k]}"; done + for k in "${sorted_keys[@]}"; do + echo "- \${args[$k]} = ${args[$k]}" + done else echo args: none fi @@ -449,9 +451,19 @@ inspect_args() { readarray -t sorted_keys < <(printf '%s\n' "${!deps[@]}" | sort) echo echo deps: - for k in "${sorted_keys[@]}"; do echo "- \${deps[$k]} = ${deps[$k]}"; done + for k in "${sorted_keys[@]}"; do + echo "- \${deps[$k]} = ${deps[$k]}" + done fi + if ((${#env_var_names[@]})); then + readarray -t sorted_names < <(printf '%s\n' "${env_var_names[@]}" | sort) + echo + echo "environment variables:" + for k in "${sorted_names[@]}"; do + echo "- \$$k = ${!k:-}" + done + fi } # :command.user_lib @@ -926,6 +938,10 @@ parse_requirements() { esac done + # :command.environment_variables_filter + + env_var_names+=("ALF_RC_FILE") + # :command.command_filter action=${1:-} @@ -1097,7 +1113,6 @@ alf_connect_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['repo']+x} ]]; then - args['repo']=$1 shift else @@ -1284,6 +1299,10 @@ alf_save_parse_requirements() { esac done + # :command.environment_variables_filter + + env_var_names+=("ALF_ALIASES_FILE") + # :command.command_filter action="save" @@ -1389,11 +1408,9 @@ alf_which_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['code']+x} ]]; then - args['code']=$1 shift elif [[ -z ${args['subcode']+x} ]]; then - args['subcode']=$1 shift else @@ -1536,6 +1553,7 @@ run() { declare -A args=() declare -A deps=() declare -a other_args=() + declare -a env_var_names=() declare -a input=() normalize_input "$@" parse_requirements "${input[@]}" diff --git a/doc/alf-connect.1 b/doc/alf-connect.1 index 0de6dfa..c11d25c 100644 --- a/doc/alf-connect.1 +++ b/doc/alf-connect.1 @@ -1,35 +1,16 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-connect" "1" "September 2023" "" "Connect to a remote git repository." -.hy +.TH "alf-connect" "1" "February 2024" "" "Connect to a remote git repository." .SH NAME -.PP \f[B]alf connect\f[R] - Connect to a remote git repository. .SH SYNOPSIS -.PP \f[B]alf connect\f[R] REPO OPTIONS .SH DESCRIPTION -.PP Connect to a remote git repository. .IP \[bu] 2 Alias: \f[B]c\f[R] .SH ARGUMENTS .SS REPO -.PP Remote GitHub repository to connect to. .PP Can be one of: @@ -44,28 +25,22 @@ Any other full URL to a repository. \f[I]Required\f[R] .SH OPTIONS .SS --ssh -.PP Connect to GitHub non-interactively using SSH (implies \f[B]--yes\f[R]). .SS --https -.PP Connect to GitHub non-interactively using HTTPS (implies \f[B]--yes\f[R]). .SS --yes, -y -.PP Connect to any remote repository non-interactively. .SH DEPENDENCIES .SS git .SH EXAMPLES .IP -.nf -\f[C] +.EX alf connect you --ssh alf connect you/alf-config alf connect https://You\[at]bitbucket.org/YourUser/rush-repo.git --yes -\f[R] -.fi +.EE .SH SEE ALSO -.PP \f[B]alf\f[R](1) diff --git a/doc/alf-connect.md b/doc/alf-connect.md index 8248e09..d8f201f 100644 --- a/doc/alf-connect.md +++ b/doc/alf-connect.md @@ -1,6 +1,6 @@ % alf-connect(1) | Connect to a remote git repository. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf-download.1 b/doc/alf-download.1 index 65a48dd..d984f15 100644 --- a/doc/alf-download.1 +++ b/doc/alf-download.1 @@ -1,34 +1,15 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-download" "1" "September 2023" "" "Perform git pull on the connected repo." -.hy +.TH "alf-download" "1" "February 2024" "" "Perform git pull on the connected repo." .SH NAME -.PP \f[B]alf download\f[R] - Perform git pull on the connected repo. .SH SYNOPSIS -.PP \f[B]alf download\f[R] .SH DESCRIPTION -.PP Perform git pull on the connected repo. .IP \[bu] 2 Alias: \f[B]d, pull\f[R] .SH DEPENDENCIES .SS git .SH SEE ALSO -.PP \f[B]alf\f[R](1) diff --git a/doc/alf-download.md b/doc/alf-download.md index 80d1277..b92f767 100644 --- a/doc/alf-download.md +++ b/doc/alf-download.md @@ -1,6 +1,6 @@ % alf-download(1) | Perform git pull on the connected repo. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf-edit.1 b/doc/alf-edit.1 index 6be09b9..801e989 100644 --- a/doc/alf-edit.1 +++ b/doc/alf-edit.1 @@ -1,32 +1,13 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-edit" "1" "September 2023" "" "Open your \f[V]alf.conf\f[R] for editing." -.hy +.TH "alf-edit" "1" "February 2024" "" "Open your \f[CR]alf.conf\f[R] for editing." .SH NAME -.PP -\f[B]alf edit\f[R] - Open your \f[V]alf.conf\f[R] for editing. +\f[B]alf edit\f[R] - Open your \f[CR]alf.conf\f[R] for editing. .SH SYNOPSIS -.PP \f[B]alf edit\f[R] .SH DESCRIPTION -.PP Open your \f[B]alf.conf\f[R] for editing. .IP \[bu] 2 Alias: \f[B]e\f[R] .SH SEE ALSO -.PP \f[B]alf\f[R](1), \f[B]alf.conf\f[R](5) diff --git a/doc/alf-edit.md b/doc/alf-edit.md index 3b1cfe0..701ed4a 100644 --- a/doc/alf-edit.md +++ b/doc/alf-edit.md @@ -1,6 +1,6 @@ % alf-edit(1) | Open your `alf.conf` for editing. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf-generate.1 b/doc/alf-generate.1 index 7c73d5b..c74081e 100644 --- a/doc/alf-generate.1 +++ b/doc/alf-generate.1 @@ -1,32 +1,13 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-generate" "1" "September 2023" "" "Generate aliases to stdout." -.hy +.TH "alf-generate" "1" "February 2024" "" "Generate aliases to stdout." .SH NAME -.PP \f[B]alf generate\f[R] - Generate aliases to stdout. .SH SYNOPSIS -.PP \f[B]alf generate\f[R] .SH DESCRIPTION -.PP Generate aliases to stdout. .IP \[bu] 2 Alias: \f[B]g\f[R] .SH SEE ALSO -.PP \f[B]alf\f[R](1) diff --git a/doc/alf-generate.md b/doc/alf-generate.md index db27201..6c98d17 100644 --- a/doc/alf-generate.md +++ b/doc/alf-generate.md @@ -1,6 +1,6 @@ % alf-generate(1) | Generate aliases to stdout. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf-info.1 b/doc/alf-info.1 index eacfa24..6c22080 100644 --- a/doc/alf-info.1 +++ b/doc/alf-info.1 @@ -1,32 +1,13 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-info" "1" "September 2023" "" "Show all alf related system facts." -.hy +.TH "alf-info" "1" "February 2024" "" "Show all alf related system facts." .SH NAME -.PP \f[B]alf info\f[R] - Show all alf related system facts. .SH SYNOPSIS -.PP \f[B]alf info\f[R] .SH DESCRIPTION -.PP Show all alf related system facts. .SH DEPENDENCIES .SS git .SH SEE ALSO -.PP \f[B]alf\f[R](1) diff --git a/doc/alf-info.md b/doc/alf-info.md index 852ea83..846daf4 100644 --- a/doc/alf-info.md +++ b/doc/alf-info.md @@ -1,6 +1,6 @@ % alf-info(1) | Show all alf related system facts. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf-save.1 b/doc/alf-save.1 index 205a81e..602adc0 100644 --- a/doc/alf-save.1 +++ b/doc/alf-save.1 @@ -1,40 +1,20 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-save" "1" "September 2023" "" "Generate aliases to \f[V]\[ti]/.bash_aliases\f[R]." -.hy +.TH "alf-save" "1" "February 2024" "" "Generate aliases to \f[CR]\[ti]/.bash_aliases\f[R]." .SH NAME -.PP -\f[B]alf save\f[R] - Generate aliases to \f[V]\[ti]/.bash_aliases\f[R]. +\f[B]alf save\f[R] - Generate aliases to \f[CR]\[ti]/.bash_aliases\f[R]. .SH SYNOPSIS -.PP \f[B]alf save\f[R] .SH DESCRIPTION -.PP Generate aliases to \f[B]\[ti]/.bash_aliases\f[R]. .IP \[bu] 2 Alias: \f[B]s\f[R] .SH ENVIRONMENT VARIABLES .SS ALF_ALIASES_FILE -.PP Path to bash_aliases file. .PP Aliases will be saved to this file. .PP Default: \f[B]\[ti]/.bash_aliases\f[R] .SH SEE ALSO -.PP \f[B]alf\f[R](1) diff --git a/doc/alf-save.md b/doc/alf-save.md index 0d5318a..ac8c2d3 100644 --- a/doc/alf-save.md +++ b/doc/alf-save.md @@ -1,6 +1,6 @@ % alf-save(1) | Generate aliases to `~/.bash_aliases`. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf-upgrade.1 b/doc/alf-upgrade.1 index 47c32dd..b826bd6 100644 --- a/doc/alf-upgrade.1 +++ b/doc/alf-upgrade.1 @@ -1,32 +1,13 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-upgrade" "1" "September 2023" "" "Upgrade alf to the latest version." -.hy +.TH "alf-upgrade" "1" "February 2024" "" "Upgrade alf to the latest version." .SH NAME -.PP \f[B]alf upgrade\f[R] - Upgrade alf to the latest version. .SH SYNOPSIS -.PP \f[B]alf upgrade\f[R] .SH DESCRIPTION -.PP Upgrade alf to the latest version. .SH DEPENDENCIES .SS curl .SH SEE ALSO -.PP \f[B]alf\f[R](1) diff --git a/doc/alf-upgrade.md b/doc/alf-upgrade.md index 4cbb3e7..da870f3 100644 --- a/doc/alf-upgrade.md +++ b/doc/alf-upgrade.md @@ -1,6 +1,6 @@ % alf-upgrade(1) | Upgrade alf to the latest version. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf-upload.1 b/doc/alf-upload.1 index 3279738..68776ca 100644 --- a/doc/alf-upload.1 +++ b/doc/alf-upload.1 @@ -1,35 +1,16 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-upload" "1" "September 2023" "" "Perform git commit and push on the connected repo." -.hy +.TH "alf-upload" "1" "February 2024" "" "Perform git commit and push on the connected repo." .SH NAME -.PP \f[B]alf upload\f[R] - Perform git commit and push on the connected repo. .SH SYNOPSIS -.PP \f[B]alf upload\f[R] .SH DESCRIPTION -.PP Perform git commit and push on the connected repo. .IP \[bu] 2 Alias: \f[B]u, push\f[R] .SH DEPENDENCIES .SS git .SH SEE ALSO -.PP \f[B]alf\f[R](1) diff --git a/doc/alf-upload.md b/doc/alf-upload.md index ff1f393..a5a27da 100644 --- a/doc/alf-upload.md +++ b/doc/alf-upload.md @@ -1,6 +1,6 @@ % alf-upload(1) | Perform git commit and push on the connected repo. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf-which.1 b/doc/alf-which.1 index cbeea3a..f6d4d39 100644 --- a/doc/alf-which.1 +++ b/doc/alf-which.1 @@ -1,41 +1,20 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf-which" "1" "September 2023" "" "Show the alias command." -.hy +.TH "alf-which" "1" "February 2024" "" "Show the alias command." .SH NAME -.PP \f[B]alf which\f[R] - Show the alias command. .SH SYNOPSIS -.PP \f[B]alf which\f[R] CODE SUBCODE .SH DESCRIPTION -.PP Show the alias command. .IP \[bu] 2 Alias: \f[B]w\f[R] .SH ARGUMENTS .SS CODE -.PP Show the command for this alias code. .IP \[bu] 2 \f[I]Required\f[R] .SS SUBCODE -.PP Show the command for this alias sub-code. .SH SEE ALSO -.PP \f[B]alf\f[R](1) diff --git a/doc/alf-which.md b/doc/alf-which.md index b54de1a..3b5e8f2 100644 --- a/doc/alf-which.md +++ b/doc/alf-which.md @@ -1,6 +1,6 @@ % alf-which(1) | Show the alias command. % -% September 2023 +% February 2024 NAME ================================================== diff --git a/doc/alf.1 b/doc/alf.1 index eaebb37..dbec418 100644 --- a/doc/alf.1 +++ b/doc/alf.1 @@ -1,77 +1,46 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} -.TH "alf" "1" "September 2023" "Version 0.6.0" "Your Little Bash Alias Friend" -.hy +.TH "alf" "1" "February 2024" "Version 0.6.0" "Your Little Bash Alias Friend" .SH NAME -.PP \f[B]alf\f[R] - Your Little Bash Alias Friend .SH SYNOPSIS -.PP \f[B]alf\f[R] COMMAND .SH DESCRIPTION -.PP Your Little Bash Alias Friend .SH COMMANDS .SS alf connect -.PP Connect to a remote git repository. .SS alf download -.PP Perform git pull on the connected repo. .SS alf upload -.PP Perform git commit and push on the connected repo. .SS alf generate -.PP Generate aliases to stdout. .SS alf save -.PP Generate aliases to \f[B]\[ti]/.bash_aliases\f[R]. .SS alf edit -.PP Open your \f[B]alf.conf\f[R] for editing. .SS alf which -.PP Show the alias command. .SS alf upgrade -.PP Upgrade alf to the latest version. .SS alf info -.PP Show all alf related system facts. .SH ENVIRONMENT VARIABLES .SS ALF_RC_FILE -.PP Path to alfrc file. .PP This file holds the path to the alf-conf repository. .PP Default: \f[B]\[ti]/.alfrc\f[R] .SH SEE ALSO -.PP \f[B]alf-connect\f[R](1), \f[B]alf-download\f[R](1), \f[B]alf-upload\f[R](1), \f[B]alf-generate\f[R](1), \f[B]alf-save\f[R](1), \f[B]alf-edit\f[R](1), \f[B]alf-which\f[R](1), \f[B]alf-upgrade\f[R](1), \f[B]alf-info\f[R](1), \f[B]alf.conf\f[R](5) .SH SOURCE CODE -.PP https://github.com/dannyben/alf .SH ISSUE TRACKER -.PP https://github.com/dannyben/alf/issues .SH AUTHORS Danny Ben Shitrit . diff --git a/doc/alf.conf.5 b/doc/alf.conf.5 index 9796e11..f2f49ac 100644 --- a/doc/alf.conf.5 +++ b/doc/alf.conf.5 @@ -1,100 +1,67 @@ -.\" Automatically generated by Pandoc 3.1.6 +.\" Automatically generated by Pandoc 3.1.9 .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} .TH "alf.conf" "5" "September 2023" "alf.conf(5)" "File Formats Manual" -.hy .SH NAME -.PP \f[B]alf.conf\f[R] - configuration file for alf .SH DESCRIPTION -.PP The \f[B]alf.conf\f[R] file consists of aliases and the command associated with them. .SS Base Aliases -.PP Any line that does not start with a whitespace is considered a base alias. .IP -.nf -\f[C] +.EX dir: ls -l -\f[R] -.fi +.EE .SS Sub Aliases -.PP Any line that starts with one or more whitespaces will be nested as a sub command of the previous base alias. Note that the command of the base alias will be used as a prefix to all nested commands. .IP -.nf -\f[C] +.EX g: git s: status c: add . --all && git commit -am l: log --all --graph --date=relative p: push -\f[R] -.fi +.EE .PP In this example, running \f[B]g s\f[R] will execute \f[B]git status\f[R]. .SS Reusing Aliases -.PP You can call an alias from another alias. .IP -.nf -\f[C] +.EX g: git p: push gg: g p -\f[R] -.fi +.EE .PP In this example, running \f[B]gg\f[R] will execute \f[B]git push\f[R]. .SS Escape Code -.PP Sub commands that start with an exclamation mark will not be prefixed by their base command. .IP -.nf -\f[C] +.EX dc: docker-compose deploy: !docker stack deploy -c docker-compose.yml upd: up -d -\f[R] -.fi +.EE .SS Virtual Command -.PP When you do not need to prepend your sub aliases with the primary command, specify an exclamation mark in the primary command. .IP -.nf -\f[C] +.EX dns: ! check: host -t ns flush: sudo systemd-resolve --flush-caches -\f[R] -.fi +.EE .PP This example provides two completely different aliases: \f[B]dns check\f[R] and \f[B]dns flush\f[R]. .SS Arguments -.PP By default, all arguments that are provided in the input are passed on to the alias, using \f[B]\[dq]$\[at]\[dq]\f[R]. If your command contains the \f[B]$\f[R] symbol, then the array of @@ -103,33 +70,25 @@ arguments will NOT be appended to the command. You can even provide a default value to the argument using the standard bash syntax, and use any bash construct, like inline functions. .IP -.nf -\f[C] +.EX count: find ${1:-.} -type f | wc -l binlink: sudo ln -fs \[dq]$(realpath $1)\[dq] \[dq]/usr/local/bin/$1\[dq] -\f[R] -.fi +.EE .SS Comments -.PP Any line starting with \f[B]#\f[R] will be considered a comment. Do not use inline comments. .IP -.nf -\f[C] +.EX # good dir: ls -l dir: ls -l # bad -\f[R] -.fi +.EE .SH SEE ALSO -.PP \f[B]alf\f[R](1) .SH SOURCE CODE -.PP https://github.com/dannyben/alf .SH ISSUE TRACKER -.PP https://github.com/dannyben/alf/issues .SH AUTHORS Danny Ben Shitrit . diff --git a/doc/alf.md b/doc/alf.md index cf56ed8..e74d7f2 100644 --- a/doc/alf.md +++ b/doc/alf.md @@ -1,6 +1,6 @@ % alf(1) Version 0.6.0 | Your Little Bash Alias Friend % Danny Ben Shitrit \ -% September 2023 +% February 2024 NAME ================================================== diff --git a/test/approvals.bash b/test/approvals.bash index 123a03d..e32ccda 100644 --- a/test/approvals.bash +++ b/test/approvals.bash @@ -1,4 +1,4 @@ -# approvals.bash v0.4.0 +# approvals.bash v0.4.2 # # Interactive approval testing for Bash. # https://github.com/DannyBen/approvals.bash @@ -9,8 +9,8 @@ approve() { cmd=$1 last_exit_code=0 actual=$(eval "$cmd" 2>&1) || last_exit_code=$? - if [[ "$allow_diff_regex" ]]; then - actual=$(echo "$actual" | sed "s/$allow_diff_regex/*/g") + if [[ -v allow_diff_regex && "$allow_diff_regex" ]]; then + actual=$(echo "$actual" | sed -E "s/$allow_diff_regex/*/g") unset allow_diff_regex fi approval=$(printf "%b" "$cmd" | tr -s -c "[:alnum:]" _)