diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 067cef5..e4ee27d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Add repo root to PATH run: echo "$PWD" >> $GITHUB_PATH - name: Run acceptance tests - run: shellkin test + run: shellkin ubuntu_setup: name: Setup on Ubuntu diff --git a/doc/rush-add.1 b/doc/rush-add.1 index fc4520a..f4eba99 100644 --- a/doc/rush-add.1 +++ b/doc/rush-add.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-add" "1" "March 2026" "" "Register a local repository." +.TH "rush\-add" "1" "July 2026" "" "Register a local repository." .SH NAME \f[B]rush add\f[R] \- Register a local repository. .SH SYNOPSIS diff --git a/doc/rush-add.md b/doc/rush-add.md index 4aaa89f..d6faa49 100644 --- a/doc/rush-add.md +++ b/doc/rush-add.md @@ -1,6 +1,6 @@ % rush-add(1) | Register a local repository. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-clone.1 b/doc/rush-clone.1 index b170d4a..5ff39f2 100644 --- a/doc/rush-clone.1 +++ b/doc/rush-clone.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-clone" "1" "March 2026" "" "Clone a GitHub package repository." +.TH "rush\-clone" "1" "July 2026" "" "Clone a GitHub package repository." .SH NAME \f[B]rush clone\f[R] \- Clone a GitHub package repository. .SH SYNOPSIS diff --git a/doc/rush-clone.md b/doc/rush-clone.md index 90ae053..2174a7e 100644 --- a/doc/rush-clone.md +++ b/doc/rush-clone.md @@ -1,6 +1,6 @@ % rush-clone(1) | Clone a GitHub package repository. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-completions.1 b/doc/rush-completions.1 index 4a7da28..1bc0de6 100644 --- a/doc/rush-completions.1 +++ b/doc/rush-completions.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-completions" "1" "March 2026" "" "Generate bash completions." +.TH "rush\-completions" "1" "July 2026" "" "Generate bash completions." .SH NAME \f[B]rush completions\f[R] \- Generate bash completions. .SH SYNOPSIS diff --git a/doc/rush-completions.md b/doc/rush-completions.md index 98c4215..54416e7 100644 --- a/doc/rush-completions.md +++ b/doc/rush-completions.md @@ -1,6 +1,6 @@ % rush-completions(1) | Generate bash completions. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-config.1 b/doc/rush-config.1 index c096242..f508563 100644 --- a/doc/rush-config.1 +++ b/doc/rush-config.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-config" "1" "March 2026" "" "Show or edit the configuration file." +.TH "rush\-config" "1" "July 2026" "" "Show or edit the configuration file." .SH NAME \f[B]rush config\f[R] \- Show or edit the configuration file. .SH SYNOPSIS diff --git a/doc/rush-config.md b/doc/rush-config.md index 9faae9e..dc05b94 100644 --- a/doc/rush-config.md +++ b/doc/rush-config.md @@ -1,6 +1,6 @@ % rush-config(1) | Show or edit the configuration file. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-copy.1 b/doc/rush-copy.1 index 515ec74..84fe400 100644 --- a/doc/rush-copy.1 +++ b/doc/rush-copy.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-copy" "1" "March 2026" "" "Copy a package between local repositories." +.TH "rush\-copy" "1" "July 2026" "" "Copy a package between local repositories." .SH NAME \f[B]rush copy\f[R] \- Copy a package between local repositories. .SH SYNOPSIS diff --git a/doc/rush-copy.md b/doc/rush-copy.md index 3fb2a89..c6aeef4 100644 --- a/doc/rush-copy.md +++ b/doc/rush-copy.md @@ -1,6 +1,6 @@ % rush-copy(1) | Copy a package between local repositories. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-default.1 b/doc/rush-default.1 index e63263a..e5e8bf3 100644 --- a/doc/rush-default.1 +++ b/doc/rush-default.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-default" "1" "March 2026" "" "Set a default repository." +.TH "rush\-default" "1" "July 2026" "" "Set a default repository." .SH NAME \f[B]rush default\f[R] \- Set a default repository. .SH SYNOPSIS diff --git a/doc/rush-default.md b/doc/rush-default.md index e546464..620a974 100644 --- a/doc/rush-default.md +++ b/doc/rush-default.md @@ -1,6 +1,6 @@ % rush-default(1) | Set a default repository. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-edit.1 b/doc/rush-edit.1 index a281852..7d7df9b 100644 --- a/doc/rush-edit.1 +++ b/doc/rush-edit.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-edit" "1" "March 2026" "" "Edit package files." +.TH "rush\-edit" "1" "July 2026" "" "Edit package files." .SH NAME \f[B]rush edit\f[R] \- Edit package files. .SH SYNOPSIS diff --git a/doc/rush-edit.md b/doc/rush-edit.md index 726f8bd..b4eef57 100644 --- a/doc/rush-edit.md +++ b/doc/rush-edit.md @@ -1,6 +1,6 @@ % rush-edit(1) | Edit package files. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-get.1 b/doc/rush-get.1 index 7b78db6..8da6175 100644 --- a/doc/rush-get.1 +++ b/doc/rush-get.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-get" "1" "March 2026" "" "Install a package." +.TH "rush\-get" "1" "July 2026" "" "Install a package." .SH NAME \f[B]rush get\f[R] \- Install a package. .SH SYNOPSIS diff --git a/doc/rush-get.md b/doc/rush-get.md index 957b06b..fa66eaa 100644 --- a/doc/rush-get.md +++ b/doc/rush-get.md @@ -1,6 +1,6 @@ % rush-get(1) | Install a package. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-info.1 b/doc/rush-info.1 index 7ff855d..fb1b52d 100644 --- a/doc/rush-info.1 +++ b/doc/rush-info.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-info" "1" "March 2026" "" "Show information about a package." +.TH "rush\-info" "1" "July 2026" "" "Show information about a package." .SH NAME \f[B]rush info\f[R] \- Show information about a package. .SH SYNOPSIS diff --git a/doc/rush-info.md b/doc/rush-info.md index 711bf81..3919683 100644 --- a/doc/rush-info.md +++ b/doc/rush-info.md @@ -1,6 +1,6 @@ % rush-info(1) | Show information about a package. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-list.1 b/doc/rush-list.1 index f71540f..7bc0ad3 100644 --- a/doc/rush-list.1 +++ b/doc/rush-list.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-list" "1" "March 2026" "" "Show packages in one or all repositories." +.TH "rush\-list" "1" "July 2026" "" "Show packages in one or all repositories." .SH NAME \f[B]rush list\f[R] \- Show packages in one or all repositories. .SH SYNOPSIS diff --git a/doc/rush-list.md b/doc/rush-list.md index 07518c1..4ab85c4 100644 --- a/doc/rush-list.md +++ b/doc/rush-list.md @@ -1,6 +1,6 @@ % rush-list(1) | Show packages in one or all repositories. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-pull.1 b/doc/rush-pull.1 index 5fc0328..6ee9306 100644 --- a/doc/rush-pull.1 +++ b/doc/rush-pull.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-pull" "1" "March 2026" "" "Git pull one or all repositories." +.TH "rush\-pull" "1" "July 2026" "" "Git pull one or all repositories." .SH NAME \f[B]rush pull\f[R] \- Git pull one or all repositories. .SH SYNOPSIS diff --git a/doc/rush-pull.md b/doc/rush-pull.md index 7418f96..dd03315 100644 --- a/doc/rush-pull.md +++ b/doc/rush-pull.md @@ -1,6 +1,6 @@ % rush-pull(1) | Git pull one or all repositories. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-push.1 b/doc/rush-push.1 index c40ab19..7320889 100644 --- a/doc/rush-push.1 +++ b/doc/rush-push.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-push" "1" "March 2026" "" "Git push one or all repositories." +.TH "rush\-push" "1" "July 2026" "" "Git push one or all repositories." .SH NAME \f[B]rush push\f[R] \- Git push one or all repositories. .SH SYNOPSIS diff --git a/doc/rush-push.md b/doc/rush-push.md index cc11b39..f5e4b11 100644 --- a/doc/rush-push.md +++ b/doc/rush-push.md @@ -1,6 +1,6 @@ % rush-push(1) | Git push one or all repositories. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-remove.1 b/doc/rush-remove.1 index 4a0dbe5..f07be6e 100644 --- a/doc/rush-remove.1 +++ b/doc/rush-remove.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-remove" "1" "March 2026" "" "Unregister a local repository." +.TH "rush\-remove" "1" "July 2026" "" "Unregister a local repository." .SH NAME \f[B]rush remove\f[R] \- Unregister a local repository. .SH SYNOPSIS diff --git a/doc/rush-remove.md b/doc/rush-remove.md index 27df750..ae8a1d0 100644 --- a/doc/rush-remove.md +++ b/doc/rush-remove.md @@ -1,6 +1,6 @@ % rush-remove(1) | Unregister a local repository. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-search.1 b/doc/rush-search.1 index bc54468..1e14862 100644 --- a/doc/rush-search.1 +++ b/doc/rush-search.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-search" "1" "March 2026" "" "Search in package names and info files." +.TH "rush\-search" "1" "July 2026" "" "Search in package names and info files." .SH NAME \f[B]rush search\f[R] \- Search in package names and info files. .SH SYNOPSIS diff --git a/doc/rush-search.md b/doc/rush-search.md index 1e5731a..b1d7e75 100644 --- a/doc/rush-search.md +++ b/doc/rush-search.md @@ -1,6 +1,6 @@ % rush-search(1) | Search in package names and info files. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-show.1 b/doc/rush-show.1 index 252ade3..1685580 100644 --- a/doc/rush-show.1 +++ b/doc/rush-show.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-show" "1" "March 2026" "" "Show package files." +.TH "rush\-show" "1" "July 2026" "" "Show package files." .SH NAME \f[B]rush show\f[R] \- Show package files. .SH SYNOPSIS diff --git a/doc/rush-show.md b/doc/rush-show.md index 05c19eb..0627a38 100644 --- a/doc/rush-show.md +++ b/doc/rush-show.md @@ -1,6 +1,6 @@ % rush-show(1) | Show package files. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-snatch.1 b/doc/rush-snatch.1 index 25c50a8..4b6f066 100644 --- a/doc/rush-snatch.1 +++ b/doc/rush-snatch.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-snatch" "1" "March 2026" "" "Install a package from a remote repo." +.TH "rush\-snatch" "1" "July 2026" "" "Install a package from a remote repo." .SH NAME \f[B]rush snatch\f[R] \- Install a package from a remote repo. .SH SYNOPSIS diff --git a/doc/rush-snatch.md b/doc/rush-snatch.md index c01471f..95a5094 100644 --- a/doc/rush-snatch.md +++ b/doc/rush-snatch.md @@ -1,6 +1,6 @@ % rush-snatch(1) | Install a package from a remote repo. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush-undo.1 b/doc/rush-undo.1 index b3e6c6d..6df386e 100644 --- a/doc/rush-undo.1 +++ b/doc/rush-undo.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush\-undo" "1" "March 2026" "" "Uninstall a package." +.TH "rush\-undo" "1" "July 2026" "" "Uninstall a package." .SH NAME \f[B]rush undo\f[R] \- Uninstall a package. .SH SYNOPSIS diff --git a/doc/rush-undo.md b/doc/rush-undo.md index d2acd16..49dbd7a 100644 --- a/doc/rush-undo.md +++ b/doc/rush-undo.md @@ -1,6 +1,6 @@ % rush-undo(1) | Uninstall a package. % -% March 2026 +% July 2026 NAME ================================================== diff --git a/doc/rush.1 b/doc/rush.1 index a0fbf91..7a97c25 100644 --- a/doc/rush.1 +++ b/doc/rush.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.9 .\" -.TH "rush" "1" "March 2026" "Version 1.0.0" "Personal package manager." +.TH "rush" "1" "July 2026" "Version 1.0.0" "Personal package manager." .SH NAME \f[B]rush\f[R] \- Personal package manager. .SH SYNOPSIS diff --git a/doc/rush.md b/doc/rush.md index 6bf6f8c..1b03528 100644 --- a/doc/rush.md +++ b/doc/rush.md @@ -1,6 +1,6 @@ % rush(1) Version 1.0.0 | Personal package manager. % Danny Ben Shitrit \ -% March 2026 +% July 2026 NAME ================================================== diff --git a/op.conf b/op.conf index 5673671..52090eb 100644 --- a/op.conf +++ b/op.conf @@ -26,6 +26,11 @@ man: bashly render :mandoc doc && op man-zip #? Render the man pages #? This is called automatically when running `op generate` +## Bash Completion + +install-completions: rush completions | ssi install completion - --name rush +#? Install bash completions (requires ssi) + private man-zip: tar -czf ./tmp/manpages.tar.gz -C doc . && echo "saved tmp/manpages.tar.gz" diff --git a/rush b/rush index 3c5913e..9a1dd3f 100755 --- a/rush +++ b/rush @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# This script was generated by bashly 1.3.6 (https://bashly.dev) +# This script was generated by bashly 1.4.0.rc2 (https://bashly.dev) # Modifying it manually is not recommended # :wrapper.bash3_bouncer @@ -1019,7 +1019,7 @@ ini_load() { elif [[ $line =~ $key_regex ]]; then key="${BASH_REMATCH[1]}" value="${BASH_REMATCH[2]}" - [[ $value == *\$* ]] && eval "value=\"$value\"" + [[ $value == *\$* ]] && value=$(envsubst <<<"$value") ini["${section}${key}"]="$value" fi done <"$ini_file" @@ -1255,183 +1255,479 @@ send_completions() { echo $'# completely (https://github.com/bashly-framework/completely)' echo $'# Modifying it manually is not recommended' echo $'' - echo $'_rush_completions_filter() {' - echo $' local words="$1"' - echo $' local cur=${COMP_WORDS[COMP_CWORD]}' - echo $' local result=()' + echo $'_rush_completions_route_flag_expects_value() {' + echo $' case "$1:$2" in' + echo $' 2:--name|2:-n) return 0 ;;' + echo $' 4:--message|4:-m) return 0 ;;' + echo $' esac' echo $'' - echo $' # words the user already typed (excluding the command itself)' - echo $' local used=()' - echo $' if ((COMP_CWORD > 1)); then' - echo $' used=("${COMP_WORDS[@]:1:$((COMP_CWORD - 1))}")' + echo $' return 1' + echo $'}' + echo $'' + echo $'_rush_completions_option_seen() {' + echo $' local completed_option option_name' + echo $' for completed_option in "${completed_options[@]}"; do' + echo $' for option_name in "$@"; do' + echo $' [[ "$completed_option" == "$option_name" ]] && return 0' + echo $' done' + echo $' done' + echo $'' + echo $' return 1' + echo $'}' + echo $'' + echo $'_rush_completions_resolve_route() {' + echo $' route_id=' + echo $' route_word_count=-1' + echo $' route_has_positionals=0' + echo $' positional_index=0' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "add" || "${non_options[0]}" == "a" ]]' + echo $' then' + echo $' route_id=0' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' echo $' fi' echo $'' - echo $' if [[ "${cur:0:1}" == "-" ]]; then' - echo $' # Completing an option: offer everything (including options)' - echo $' echo "$words"' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "remove" || "${non_options[0]}" == "r" ]]' + echo $' then' + echo $' route_id=1' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' else' - echo $' # Completing a non-option: offer only non-options,' - echo $' # and don\'t re-offer ones already used earlier in the line.' - echo $' for word in $words; do' - echo $' [[ "${word:0:1}" == "-" ]] && continue' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "clone" ]]' + echo $' then' + echo $' route_id=2' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' local seen=0' - echo $' for u in "${used[@]}"; do' - echo $' if [[ "$u" == "$word" ]]; then' - echo $' seen=1' - echo $' break' - echo $' fi' - echo $' done' - echo $' ((!seen)) && result+=("$word")' - echo $' done' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "pull" || "${non_options[0]}" == "p" || "${non_options[0]}" == "download" || "${non_options[0]}" == "update" ]]' + echo $' then' + echo $' route_id=3' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "push" || "${non_options[0]}" == "upload" ]]' + echo $' then' + echo $' route_id=4' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' echo "${result[*]}"' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "config" || "${non_options[0]}" == "c" ]]' + echo $' then' + echo $' route_id=5' + echo $' route_word_count=1' + echo $' route_has_positionals=0' + echo $' positional_index=$((${#non_options[@]} - 1))' echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "default" ]]' + echo $' then' + echo $' route_id=6' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 0 )) &&' + echo $' (( 0 > route_word_count ))' + echo $' then' + echo $' route_id=7' + echo $' route_word_count=0' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 0))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "get" || "${non_options[0]}" == "g" ]]' + echo $' then' + echo $' route_id=8' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "undo" || "${non_options[0]}" == "u" ]]' + echo $' then' + echo $' route_id=9' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "snatch" ]]' + echo $' then' + echo $' route_id=10' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "copy" ]]' + echo $' then' + echo $' route_id=11' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "info" || "${non_options[0]}" == "i" ]]' + echo $' then' + echo $' route_id=12' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "list" || "${non_options[0]}" == "l" || "${non_options[0]}" == "ls" ]]' + echo $' then' + echo $' route_id=13' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "search" || "${non_options[0]}" == "s" ]]' + echo $' then' + echo $' route_id=14' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "edit" || "${non_options[0]}" == "e" ]]' + echo $' then' + echo $' route_id=15' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "show" ]]' + echo $' then' + echo $' route_id=16' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "completions" ]]' + echo $' then' + echo $' route_id=17' + echo $' route_word_count=1' + echo $' route_has_positionals=0' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' + echo $'' echo $'}' echo $'' echo $'_rush_completions() {' echo $' local cur=${COMP_WORDS[COMP_CWORD]}' - echo $' local compwords=()' + echo $' local prev=' echo $' if ((COMP_CWORD > 0)); then' - echo $' compwords=("${COMP_WORDS[@]:1:$((COMP_CWORD - 1))}")' + echo $' prev=${COMP_WORDS[$((COMP_CWORD - 1))]}' echo $' fi' - echo $' local compline="${compwords[*]}"' echo $'' - echo $' COMPREPLY=()' - echo $'' - echo $' case "$compline" in' - echo $' \'completions\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' local completed=()' + echo $' if ((COMP_CWORD > 1)); then' + echo $' completed=("${COMP_WORDS[@]:1:$((COMP_CWORD - 1))}")' + echo $' fi' echo $'' - echo $' \'download\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' local non_options=()' + echo $' local completed_options=()' + echo $' local route_id=' + echo $' local route_word_count=-1' + echo $' local route_has_positionals=0' + echo $' local positional_index=0' + echo $' _rush_completions_resolve_route' echo $'' - echo $' \'default\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' local skip_next=0' + echo $' for word in "${completed[@]}"; do' + echo $' if ((skip_next)); then' + echo $' skip_next=0' + echo $' continue' + echo $' fi' echo $'' - echo $' \'snatch\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--force --help --undo --verbose -f -h -u -v")" -- "$cur")' - echo $' ;;' + echo $' if [[ "${word:0:1}" == "-" ]]; then' + echo $' completed_options+=("$word")' + echo $' if _rush_completions_route_flag_expects_value "$route_id" "$word"; then' + echo $' skip_next=1' + echo $' fi' + echo $' continue' + echo $' fi' echo $'' - echo $' \'search\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' non_options+=("$word")' + echo $' _rush_completions_resolve_route' + echo $' done' echo $'' - echo $' \'config\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur")' - echo $' ;;' + echo $' COMPREPLY=()' echo $'' - echo $' \'upload\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --message -a -h -m")" -- "$cur")' - echo $' ;;' + echo $' if [[ -z "$route_id" ]] || { (( route_word_count == 0 )) && (( !route_has_positionals )) && [[ "${cur:0:1}" != "-" ]]; }; then' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "add a remove r clone pull p download update push upload config c default get g undo u snatch copy info i list l ls search s edit e show completions" -- "$cur")' + echo $' return' + echo $' fi' echo $'' - echo $' \'update\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' case "$route_id:$prev" in' + echo $' 2:--name|2:-n)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'remove\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur")' + echo $' 4:--message|4:-m)' + echo $' return' echo $' ;;' + echo $' esac' echo $'' - echo $' \'clone\'*)' - echo $' compopt -o filenames 2>/dev/null' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -W "$(_rush_completions_filter "--default --help --ignore --name --shallow --ssh -d -h -i -n -s -w")" -- "$cur")' - echo $' ;;' + echo $' if [[ "${cur:0:1}" == "-" ]]; then' + echo $' case "$route_id" in' + echo $' 0)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 1)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--purge" "-p" || words+=("--purge" "-p")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 2)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--ssh" "-s" || words+=("--ssh" "-s")' + echo $' _rush_completions_option_seen "--default" "-d" || words+=("--default" "-d")' + echo $' _rush_completions_option_seen "--name" "-n" || words+=("--name" "-n")' + echo $' _rush_completions_option_seen "--shallow" "-w" || words+=("--shallow" "-w")' + echo $' _rush_completions_option_seen "--ignore" "-i" || words+=("--ignore" "-i")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 3)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 4)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--all" "-a" || words+=("--all" "-a")' + echo $' _rush_completions_option_seen "--message" "-m" || words+=("--message" "-m")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 5)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--edit" "-e" || words+=("--edit" "-e")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 6)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 7)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--version" "-v" || words+=("--version" "-v")' + echo $' _rush_completions_option_seen "--clone" "-c" || words+=("--clone" "-c")' + echo $' _rush_completions_option_seen "--force" "-f" || words+=("--force" "-f")' + echo $' _rush_completions_option_seen "--verbose" "-v" || words+=("--verbose" "-v")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 8)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--clone" "-c" || words+=("--clone" "-c")' + echo $' _rush_completions_option_seen "--force" "-f" || words+=("--force" "-f")' + echo $' _rush_completions_option_seen "--verbose" "-v" || words+=("--verbose" "-v")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 9)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--verbose" "-v" || words+=("--verbose" "-v")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 10)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--force" "-f" || words+=("--force" "-f")' + echo $' _rush_completions_option_seen "--verbose" "-v" || words+=("--verbose" "-v")' + echo $' _rush_completions_option_seen "--undo" "-u" || words+=("--undo" "-u")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 11)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--force" "-f" || words+=("--force" "-f")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 12)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 13)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--simple" "-s" || words+=("--simple" "-s")' + echo $' _rush_completions_option_seen "--all" "-a" || words+=("--all" "-a")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 14)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 15)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 16)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 17)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' esac' + echo $' fi' echo $'' - echo $' \'edit\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' + echo $' case "$route_id:$positional_index" in' + echo $' 0:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'pull\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' 0:1)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'push\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --message -a -h -m")" -- "$cur")' + echo $' 1:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'show\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' + echo $' 2:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'undo\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help --verbose -h -v")" -- "$cur")' + echo $' 2:1)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'copy\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --force --help -f -h")" -- "$cur")' + echo $' 3:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'info\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' + echo $' 4:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'list\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur")' + echo $' 6:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'get\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --force --help --verbose -c -f -h -v")" -- "$cur")' + echo $' 7:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "add a remove r clone pull p download update push upload config c default get g undo u snatch copy info i list l ls search s edit e show completions $(rush list -s -a)" -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'add\'*)' - echo $' compopt -o filenames 2>/dev/null' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' 8:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'ls\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur")' + echo $' 9:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'e\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' + echo $' 10:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'s\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' 10:1)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'l\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur")' + echo $' 11:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'i\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' + echo $' 11:1)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'u\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help --verbose -h -v")" -- "$cur")' + echo $' 12:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'g\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --force --help --verbose -c -f -h -v")" -- "$cur")' + echo $' 13:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'c\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur")' + echo $' 14:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'p\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' 15:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'r\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur")' + echo $' 15:1)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'a\'*)' - echo $' compopt -o filenames 2>/dev/null' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' 16:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' *)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help --version -h -v a add c clone completions config copy default download e edit g get i info l list ls p pull push r remove s search show snatch u undo update upload")" -- "$cur")' + echo $' 16:1)' + echo $' return' echo $' ;;' - echo $'' echo $' esac' echo $'} &&' echo $' complete -F _rush_completions rush' diff --git a/setup b/setup index 421d0b1..6bc8b66 100755 --- a/setup +++ b/setup @@ -3,7 +3,7 @@ set -euo pipefail prepare_installer() { echo "Initializing installer..." - SSI_VERSION="0.1.8" + SSI_VERSION="0.1.10" # Set up tmp dir where all work is done tmpdir="$(mktemp -d)" diff --git a/src/bashly.yml b/src/bashly.yml index 5be42a5..360d080 100644 --- a/src/bashly.yml +++ b/src/bashly.yml @@ -31,7 +31,6 @@ commands: - name: add alias: a group: Repository - completions: [] help: |- Register a local repository. @@ -45,6 +44,7 @@ commands: - name: path required: true help: Path to the repository. + completions: [] examples: - rush add default ~/rush-repos/default @@ -74,7 +74,6 @@ commands: - name: clone group: Git dependencies: [git] - completions: [] help: |- Clone a GitHub package repository. @@ -91,6 +90,7 @@ commands: If you need to use a different name, use the `user/repo` syntax. - name: path + completions: [] help: |- Local path to clone the repository into. @@ -187,7 +187,6 @@ commands: - name: get alias: g group: Package - completions: [$(rush list -s -a)] help: |- Install a package. @@ -200,6 +199,7 @@ commands: args: - name: package required: true + completions: [$(rush list -s -a)] help: &package_help |- Package name. @@ -232,7 +232,6 @@ commands: - name: undo alias: u group: Package - completions: [$(rush list -s -a)] help: |- Uninstall a package. @@ -241,6 +240,7 @@ commands: args: - name: package required: true + completions: [$(rush list -s -a)] help: *package_help flags: @@ -293,12 +293,12 @@ commands: - name: copy group: Package - completions: [$(rush list -s -a)] help: Copy a package between local repositories. args: - name: source_package required: true + completions: [$(rush list -s -a)] help: |- Source package name. @@ -325,7 +325,6 @@ commands: - name: info alias: i group: Package - completions: [$(rush list -s -a)] help: |- Show information about a package. @@ -334,6 +333,7 @@ commands: args: - name: package required: true + completions: [$(rush list -s -a)] help: *package_help examples: @@ -385,12 +385,12 @@ commands: - name: edit alias: e group: Package - completions: [$(rush list -s -a)] help: Edit package files. args: - name: package required: true + completions: [$(rush list -s -a)] help: *package_help - name: file @@ -399,12 +399,12 @@ commands: - name: show group: Package - completions: [$(rush list -s -a)] help: Show package files. args: - name: package required: true + completions: [$(rush list -s -a)] help: *package_help - name: file diff --git a/src/lib/ini.sh b/src/lib/ini.sh index 8b2df57..752d02c 100644 --- a/src/lib/ini.sh +++ b/src/lib/ini.sh @@ -47,7 +47,7 @@ ini_load() { elif [[ $line =~ $key_regex ]]; then key="${BASH_REMATCH[1]}" value="${BASH_REMATCH[2]}" - [[ $value == *\$* ]] && eval "value=\"$value\"" + [[ $value == *\$* ]] && value=$(envsubst <<<"$value") ini["${section}${key}"]="$value" fi done <"$ini_file" diff --git a/src/lib/send_completions.sh b/src/lib/send_completions.sh index 4da72c2..434fed5 100644 --- a/src/lib/send_completions.sh +++ b/src/lib/send_completions.sh @@ -6,183 +6,479 @@ send_completions() { echo $'# completely (https://github.com/bashly-framework/completely)' echo $'# Modifying it manually is not recommended' echo $'' - echo $'_rush_completions_filter() {' - echo $' local words="$1"' - echo $' local cur=${COMP_WORDS[COMP_CWORD]}' - echo $' local result=()' + echo $'_rush_completions_route_flag_expects_value() {' + echo $' case "$1:$2" in' + echo $' 2:--name|2:-n) return 0 ;;' + echo $' 4:--message|4:-m) return 0 ;;' + echo $' esac' echo $'' - echo $' # words the user already typed (excluding the command itself)' - echo $' local used=()' - echo $' if ((COMP_CWORD > 1)); then' - echo $' used=("${COMP_WORDS[@]:1:$((COMP_CWORD - 1))}")' - echo $' fi' + echo $' return 1' + echo $'}' echo $'' - echo $' if [[ "${cur:0:1}" == "-" ]]; then' - echo $' # Completing an option: offer everything (including options)' - echo $' echo "$words"' - echo $'' - echo $' else' - echo $' # Completing a non-option: offer only non-options,' - echo $' # and don\'t re-offer ones already used earlier in the line.' - echo $' for word in $words; do' - echo $' [[ "${word:0:1}" == "-" ]] && continue' - echo $'' - echo $' local seen=0' - echo $' for u in "${used[@]}"; do' - echo $' if [[ "$u" == "$word" ]]; then' - echo $' seen=1' - echo $' break' - echo $' fi' - echo $' done' - echo $' ((!seen)) && result+=("$word")' + echo $'_rush_completions_option_seen() {' + echo $' local completed_option option_name' + echo $' for completed_option in "${completed_options[@]}"; do' + echo $' for option_name in "$@"; do' + echo $' [[ "$completed_option" == "$option_name" ]] && return 0' echo $' done' + echo $' done' echo $'' - echo $' echo "${result[*]}"' - echo $' fi' + echo $' return 1' echo $'}' echo $'' - echo $'_rush_completions() {' - echo $' local cur=${COMP_WORDS[COMP_CWORD]}' - echo $' local compwords=()' - echo $' if ((COMP_CWORD > 0)); then' - echo $' compwords=("${COMP_WORDS[@]:1:$((COMP_CWORD - 1))}")' + echo $'_rush_completions_resolve_route() {' + echo $' route_id=' + echo $' route_word_count=-1' + echo $' route_has_positionals=0' + echo $' positional_index=0' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "add" || "${non_options[0]}" == "a" ]]' + echo $' then' + echo $' route_id=0' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' echo $' fi' - echo $' local compline="${compwords[*]}"' echo $'' - echo $' COMPREPLY=()' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "remove" || "${non_options[0]}" == "r" ]]' + echo $' then' + echo $' route_id=1' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' case "$compline" in' - echo $' \'completions\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "clone" ]]' + echo $' then' + echo $' route_id=2' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'download\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "pull" || "${non_options[0]}" == "p" || "${non_options[0]}" == "download" || "${non_options[0]}" == "update" ]]' + echo $' then' + echo $' route_id=3' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'default\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "push" || "${non_options[0]}" == "upload" ]]' + echo $' then' + echo $' route_id=4' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'snatch\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--force --help --undo --verbose -f -h -u -v")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "config" || "${non_options[0]}" == "c" ]]' + echo $' then' + echo $' route_id=5' + echo $' route_word_count=1' + echo $' route_has_positionals=0' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'search\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "default" ]]' + echo $' then' + echo $' route_id=6' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'config\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 0 )) &&' + echo $' (( 0 > route_word_count ))' + echo $' then' + echo $' route_id=7' + echo $' route_word_count=0' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 0))' + echo $' fi' echo $'' - echo $' \'upload\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --message -a -h -m")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "get" || "${non_options[0]}" == "g" ]]' + echo $' then' + echo $' route_id=8' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'update\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "undo" || "${non_options[0]}" == "u" ]]' + echo $' then' + echo $' route_id=9' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'remove\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "snatch" ]]' + echo $' then' + echo $' route_id=10' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'clone\'*)' - echo $' compopt -o filenames 2>/dev/null' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -W "$(_rush_completions_filter "--default --help --ignore --name --shallow --ssh -d -h -i -n -s -w")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "copy" ]]' + echo $' then' + echo $' route_id=11' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'edit\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "info" || "${non_options[0]}" == "i" ]]' + echo $' then' + echo $' route_id=12' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'pull\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "list" || "${non_options[0]}" == "l" || "${non_options[0]}" == "ls" ]]' + echo $' then' + echo $' route_id=13' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'push\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --message -a -h -m")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "search" || "${non_options[0]}" == "s" ]]' + echo $' then' + echo $' route_id=14' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'show\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "edit" || "${non_options[0]}" == "e" ]]' + echo $' then' + echo $' route_id=15' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'undo\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help --verbose -h -v")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "show" ]]' + echo $' then' + echo $' route_id=16' + echo $' route_word_count=1' + echo $' route_has_positionals=1' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'copy\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --force --help -f -h")" -- "$cur")' - echo $' ;;' + echo $' if (( ${#non_options[@]} >= 1 )) &&' + echo $' (( 1 > route_word_count )) &&' + echo $' [[ "${non_options[0]}" == "completions" ]]' + echo $' then' + echo $' route_id=17' + echo $' route_word_count=1' + echo $' route_has_positionals=0' + echo $' positional_index=$((${#non_options[@]} - 1))' + echo $' fi' echo $'' - echo $' \'info\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' - echo $' ;;' + echo $'}' echo $'' - echo $' \'list\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur")' - echo $' ;;' + echo $'_rush_completions() {' + echo $' local cur=${COMP_WORDS[COMP_CWORD]}' + echo $' local prev=' + echo $' if ((COMP_CWORD > 0)); then' + echo $' prev=${COMP_WORDS[$((COMP_CWORD - 1))]}' + echo $' fi' echo $'' - echo $' \'get\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --force --help --verbose -c -f -h -v")" -- "$cur")' - echo $' ;;' + echo $' local completed=()' + echo $' if ((COMP_CWORD > 1)); then' + echo $' completed=("${COMP_WORDS[@]:1:$((COMP_CWORD - 1))}")' + echo $' fi' echo $'' - echo $' \'add\'*)' - echo $' compopt -o filenames 2>/dev/null' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur")' - echo $' ;;' + echo $' local non_options=()' + echo $' local completed_options=()' + echo $' local route_id=' + echo $' local route_word_count=-1' + echo $' local route_has_positionals=0' + echo $' local positional_index=0' + echo $' _rush_completions_resolve_route' + echo $'' + echo $' local skip_next=0' + echo $' for word in "${completed[@]}"; do' + echo $' if ((skip_next)); then' + echo $' skip_next=0' + echo $' continue' + echo $' fi' + echo $'' + echo $' if [[ "${word:0:1}" == "-" ]]; then' + echo $' completed_options+=("$word")' + echo $' if _rush_completions_route_flag_expects_value "$route_id" "$word"; then' + echo $' skip_next=1' + echo $' fi' + echo $' continue' + echo $' fi' + echo $'' + echo $' non_options+=("$word")' + echo $' _rush_completions_resolve_route' + echo $' done' echo $'' - echo $' \'ls\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur")' - echo $' ;;' + echo $' COMPREPLY=()' echo $'' - echo $' \'e\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' - echo $' ;;' + echo $' if [[ -z "$route_id" ]] || { (( route_word_count == 0 )) && (( !route_has_positionals )) && [[ "${cur:0:1}" != "-" ]]; }; then' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "add a remove r clone pull p download update push upload config c default get g undo u snatch copy info i list l ls search s edit e show completions" -- "$cur")' + echo $' return' + echo $' fi' echo $'' - echo $' \'s\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' case "$route_id:$prev" in' + echo $' 2:--name|2:-n)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'l\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur")' + echo $' 4:--message|4:-m)' + echo $' return' echo $' ;;' + echo $' esac' echo $'' - echo $' \'i\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur")' - echo $' ;;' + echo $' if [[ "${cur:0:1}" == "-" ]]; then' + echo $' case "$route_id" in' + echo $' 0)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 1)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--purge" "-p" || words+=("--purge" "-p")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 2)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--ssh" "-s" || words+=("--ssh" "-s")' + echo $' _rush_completions_option_seen "--default" "-d" || words+=("--default" "-d")' + echo $' _rush_completions_option_seen "--name" "-n" || words+=("--name" "-n")' + echo $' _rush_completions_option_seen "--shallow" "-w" || words+=("--shallow" "-w")' + echo $' _rush_completions_option_seen "--ignore" "-i" || words+=("--ignore" "-i")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 3)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 4)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--all" "-a" || words+=("--all" "-a")' + echo $' _rush_completions_option_seen "--message" "-m" || words+=("--message" "-m")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 5)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--edit" "-e" || words+=("--edit" "-e")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 6)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 7)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--version" "-v" || words+=("--version" "-v")' + echo $' _rush_completions_option_seen "--clone" "-c" || words+=("--clone" "-c")' + echo $' _rush_completions_option_seen "--force" "-f" || words+=("--force" "-f")' + echo $' _rush_completions_option_seen "--verbose" "-v" || words+=("--verbose" "-v")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 8)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--clone" "-c" || words+=("--clone" "-c")' + echo $' _rush_completions_option_seen "--force" "-f" || words+=("--force" "-f")' + echo $' _rush_completions_option_seen "--verbose" "-v" || words+=("--verbose" "-v")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 9)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--verbose" "-v" || words+=("--verbose" "-v")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 10)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--force" "-f" || words+=("--force" "-f")' + echo $' _rush_completions_option_seen "--verbose" "-v" || words+=("--verbose" "-v")' + echo $' _rush_completions_option_seen "--undo" "-u" || words+=("--undo" "-u")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 11)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--force" "-f" || words+=("--force" "-f")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 12)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 13)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' _rush_completions_option_seen "--simple" "-s" || words+=("--simple" "-s")' + echo $' _rush_completions_option_seen "--all" "-a" || words+=("--all" "-a")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 14)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 15)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 16)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 17)' + echo $' local words=()' + echo $' _rush_completions_option_seen "--help" "-h" || words+=("--help" "-h")' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "${words[*]}" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' esac' + echo $' fi' echo $'' - echo $' \'u\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help --verbose -h -v")" -- "$cur")' + echo $' case "$route_id:$positional_index" in' + echo $' 0:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'g\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --force --help --verbose -c -f -h -v")" -- "$cur")' + echo $' 0:1)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'c\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur")' + echo $' 1:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'p\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' 2:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' \'r\'*)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur")' + echo $' 2:1)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -- "$cur")' + echo $' return' echo $' ;;' - echo $'' - echo $' \'a\'*)' - echo $' compopt -o filenames 2>/dev/null' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur")' + echo $' 3:0)' + echo $' return' echo $' ;;' - echo $'' - echo $' *)' - echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help --version -h -v a add c clone completions config copy default download e edit g get i info l list ls p pull push r remove s search show snatch u undo update upload")" -- "$cur")' + echo $' 4:0)' + echo $' return' + echo $' ;;' + echo $' 6:0)' + echo $' return' + echo $' ;;' + echo $' 7:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "add a remove r clone pull p download update push upload config c default get g undo u snatch copy info i list l ls search s edit e show completions $(rush list -s -a)" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 8:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 9:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 10:0)' + echo $' return' + echo $' ;;' + echo $' 10:1)' + echo $' return' + echo $' ;;' + echo $' 11:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 11:1)' + echo $' return' + echo $' ;;' + echo $' 12:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 13:0)' + echo $' return' + echo $' ;;' + echo $' 14:0)' + echo $' return' + echo $' ;;' + echo $' 15:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 15:1)' + echo $' return' + echo $' ;;' + echo $' 16:0)' + echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(rush list -s -a)" -- "$cur")' + echo $' return' + echo $' ;;' + echo $' 16:1)' + echo $' return' echo $' ;;' - echo $'' echo $' esac' echo $'} &&' echo $' complete -F _rush_completions rush' diff --git a/uninstall b/uninstall index 0994515..6c57a80 100755 --- a/uninstall +++ b/uninstall @@ -3,7 +3,7 @@ set -euo pipefail prepare_installer() { echo "Initializing installer..." - SSI_VERSION="0.1.8" + SSI_VERSION="0.1.10" # Set up tmp dir where all work is done tmpdir="$(mktemp -d)"