From f5298ceeaf71c4410ede86eb8660383a4aacc04f Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Tue, 27 Feb 2024 14:40:05 +0000 Subject: [PATCH] fix typos and hide developer comments --- .codespellrc | 3 + CHANGELOG.md | 4 +- README.md | 2 +- doc/rush-add.1 | 2 +- doc/rush-add.md | 2 +- doc/rush-clone.1 | 2 +- doc/rush-clone.md | 2 +- doc/rush-completions.1 | 2 +- doc/rush-completions.md | 2 +- doc/rush-config.1 | 2 +- doc/rush-config.md | 2 +- doc/rush-copy.1 | 2 +- doc/rush-copy.md | 2 +- doc/rush-default.1 | 2 +- doc/rush-default.md | 2 +- doc/rush-edit.1 | 2 +- doc/rush-edit.md | 2 +- doc/rush-get.1 | 2 +- doc/rush-get.md | 2 +- doc/rush-info.1 | 2 +- doc/rush-info.md | 2 +- doc/rush-list.1 | 2 +- doc/rush-list.md | 2 +- doc/rush-pull.1 | 2 +- doc/rush-pull.md | 2 +- doc/rush-push.1 | 2 +- doc/rush-push.md | 2 +- doc/rush-remove.1 | 2 +- doc/rush-remove.md | 2 +- doc/rush-search.1 | 2 +- doc/rush-search.md | 2 +- doc/rush-show.1 | 2 +- doc/rush-show.md | 2 +- doc/rush-snatch.1 | 2 +- doc/rush-snatch.md | 2 +- doc/rush-undo.1 | 2 +- doc/rush-undo.md | 2 +- doc/rush.1 | 2 +- doc/rush.md | 2 +- rush | 129 +++++++++++------------------------- src/clone_command.sh | 16 ++--- src/default_command.sh | 4 +- src/edit_command.sh | 6 +- src/get_command.sh | 6 +- src/info_command.sh | 4 +- src/lib/send_completions.sh | 76 ++++++++++----------- src/search_command.sh | 6 +- src/show_command.sh | 6 +- src/snatch_command.sh | 2 +- src/undo_command.sh | 6 +- 50 files changed, 147 insertions(+), 195 deletions(-) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..3bc190e --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = coverage,tmp,Gemfile.lock,sublime* +ignore-words-list = bu diff --git a/CHANGELOG.md b/CHANGELOG.md index b286eef..9af8589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,10 +67,11 @@ v0.7.3 - 2022-06-01 - Regenerate with bashly 0.8.2 + v0.7.2 - 2022-05-12 ---------------------------------------- -- Genearte with bashly 0.8.0 +- Generate with bashly 0.8.0 v0.7.1 - 2022-01-28 @@ -152,7 +153,6 @@ v0.5.9 - 2020-10-10 - Add titles to search output sections - ## [v0.5.8](https://github.com/DannyBen/rush-cli/tree/v0.5.8) (2020-04-13) [Full Changelog](https://github.com/DannyBen/rush-cli/compare/v0.5.7...v0.5.8) diff --git a/README.md b/README.md index 9d90082..ebac6b0 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ To create a repository manually, follow these steps: 5. Note that the `main` and `undo` scripts are executed in the same folder they live in, so you can copy files from the package's directory to wherever they need to be. -6. If you need to read/write files in the user's current direcotory, use the +6. If you need to read/write files in the user's current directory, use the `$USER_CWD` environment variable. 7. The `main` and `undo` scripts can be written in any language, as long as they have a shebang line. diff --git a/doc/rush-add.1 b/doc/rush-add.1 index f18c2d2..1244311 100644 --- a/doc/rush-add.1 +++ b/doc/rush-add.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-add" "1" "January 2024" "" "Register a local repository." +.TH "rush-add" "1" "February 2024" "" "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 c5cd2e1..59905a4 100644 --- a/doc/rush-add.md +++ b/doc/rush-add.md @@ -1,6 +1,6 @@ % rush-add(1) | Register a local repository. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-clone.1 b/doc/rush-clone.1 index 975bdac..c86934e 100644 --- a/doc/rush-clone.1 +++ b/doc/rush-clone.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-clone" "1" "January 2024" "" "Clone a GitHub package repository." +.TH "rush-clone" "1" "February 2024" "" "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 d4f5ada..f66e375 100644 --- a/doc/rush-clone.md +++ b/doc/rush-clone.md @@ -1,6 +1,6 @@ % rush-clone(1) | Clone a GitHub package repository. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-completions.1 b/doc/rush-completions.1 index cee53d9..8c88b96 100644 --- a/doc/rush-completions.1 +++ b/doc/rush-completions.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-completions" "1" "January 2024" "" "Generate bash completions." +.TH "rush-completions" "1" "February 2024" "" "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 9a6ff49..0bddeaf 100644 --- a/doc/rush-completions.md +++ b/doc/rush-completions.md @@ -1,6 +1,6 @@ % rush-completions(1) | Generate bash completions. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-config.1 b/doc/rush-config.1 index dd2ba0e..33cdde9 100644 --- a/doc/rush-config.1 +++ b/doc/rush-config.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-config" "1" "January 2024" "" "Show or edit the configuration file." +.TH "rush-config" "1" "February 2024" "" "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 4812f36..2629d18 100644 --- a/doc/rush-config.md +++ b/doc/rush-config.md @@ -1,6 +1,6 @@ % rush-config(1) | Show or edit the configuration file. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-copy.1 b/doc/rush-copy.1 index 3dd19fb..8f0b1d3 100644 --- a/doc/rush-copy.1 +++ b/doc/rush-copy.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-copy" "1" "January 2024" "" "Copy a package between local repositories." +.TH "rush-copy" "1" "February 2024" "" "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 cd0f983..17f47b4 100644 --- a/doc/rush-copy.md +++ b/doc/rush-copy.md @@ -1,6 +1,6 @@ % rush-copy(1) | Copy a package between local repositories. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-default.1 b/doc/rush-default.1 index 2965091..3e7d997 100644 --- a/doc/rush-default.1 +++ b/doc/rush-default.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-default" "1" "January 2024" "" "Set a default repository." +.TH "rush-default" "1" "February 2024" "" "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 efd786a..24fd6c9 100644 --- a/doc/rush-default.md +++ b/doc/rush-default.md @@ -1,6 +1,6 @@ % rush-default(1) | Set a default repository. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-edit.1 b/doc/rush-edit.1 index a4b2e7a..fb11fcf 100644 --- a/doc/rush-edit.1 +++ b/doc/rush-edit.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-edit" "1" "January 2024" "" "Edit package files." +.TH "rush-edit" "1" "February 2024" "" "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 884ba3f..ae055f8 100644 --- a/doc/rush-edit.md +++ b/doc/rush-edit.md @@ -1,6 +1,6 @@ % rush-edit(1) | Edit package files. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-get.1 b/doc/rush-get.1 index 4bc96d5..1bc6365 100644 --- a/doc/rush-get.1 +++ b/doc/rush-get.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-get" "1" "January 2024" "" "Install a package." +.TH "rush-get" "1" "February 2024" "" "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 0d853a8..d5a2f10 100644 --- a/doc/rush-get.md +++ b/doc/rush-get.md @@ -1,6 +1,6 @@ % rush-get(1) | Install a package. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-info.1 b/doc/rush-info.1 index cbc18bd..b56bc0b 100644 --- a/doc/rush-info.1 +++ b/doc/rush-info.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-info" "1" "January 2024" "" "Show information about a package." +.TH "rush-info" "1" "February 2024" "" "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 5be7615..076b540 100644 --- a/doc/rush-info.md +++ b/doc/rush-info.md @@ -1,6 +1,6 @@ % rush-info(1) | Show information about a package. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-list.1 b/doc/rush-list.1 index 204ec58..7618fda 100644 --- a/doc/rush-list.1 +++ b/doc/rush-list.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-list" "1" "January 2024" "" "Show packages in one or all repositories." +.TH "rush-list" "1" "February 2024" "" "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 3e51499..50ba552 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. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-pull.1 b/doc/rush-pull.1 index b6ec9b0..9d487ac 100644 --- a/doc/rush-pull.1 +++ b/doc/rush-pull.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-pull" "1" "January 2024" "" "Git pull one or all repositories." +.TH "rush-pull" "1" "February 2024" "" "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 ec1ae47..49c5c05 100644 --- a/doc/rush-pull.md +++ b/doc/rush-pull.md @@ -1,6 +1,6 @@ % rush-pull(1) | Git pull one or all repositories. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-push.1 b/doc/rush-push.1 index 88be1ab..3c2d0cf 100644 --- a/doc/rush-push.1 +++ b/doc/rush-push.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-push" "1" "January 2024" "" "Git push one or all repositories." +.TH "rush-push" "1" "February 2024" "" "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 4bf7ee9..0fe16f4 100644 --- a/doc/rush-push.md +++ b/doc/rush-push.md @@ -1,6 +1,6 @@ % rush-push(1) | Git push one or all repositories. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-remove.1 b/doc/rush-remove.1 index c3bffd4..d1b1de9 100644 --- a/doc/rush-remove.1 +++ b/doc/rush-remove.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-remove" "1" "January 2024" "" "Unregister a local repository." +.TH "rush-remove" "1" "February 2024" "" "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 d41d963..edd3a25 100644 --- a/doc/rush-remove.md +++ b/doc/rush-remove.md @@ -1,6 +1,6 @@ % rush-remove(1) | Unregister a local repository. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-search.1 b/doc/rush-search.1 index 8ef3a36..83b1be5 100644 --- a/doc/rush-search.1 +++ b/doc/rush-search.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-search" "1" "January 2024" "" "Search in package names and info files." +.TH "rush-search" "1" "February 2024" "" "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 61342ef..9430a83 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. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-show.1 b/doc/rush-show.1 index ed2445c..033c776 100644 --- a/doc/rush-show.1 +++ b/doc/rush-show.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-show" "1" "January 2024" "" "Show package files." +.TH "rush-show" "1" "February 2024" "" "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 2fdbd0d..5419162 100644 --- a/doc/rush-show.md +++ b/doc/rush-show.md @@ -1,6 +1,6 @@ % rush-show(1) | Show package files. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-snatch.1 b/doc/rush-snatch.1 index b203219..1549257 100644 --- a/doc/rush-snatch.1 +++ b/doc/rush-snatch.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-snatch" "1" "January 2024" "" "Install a package from a remote repo." +.TH "rush-snatch" "1" "February 2024" "" "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 6629c64..1f47d65 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. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush-undo.1 b/doc/rush-undo.1 index 0d87ed7..c3f038d 100644 --- a/doc/rush-undo.1 +++ b/doc/rush-undo.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush-undo" "1" "January 2024" "" "Uninstall a package." +.TH "rush-undo" "1" "February 2024" "" "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 5fa4650..4d98dca 100644 --- a/doc/rush-undo.md +++ b/doc/rush-undo.md @@ -1,6 +1,6 @@ % rush-undo(1) | Uninstall a package. % -% January 2024 +% February 2024 NAME ================================================== diff --git a/doc/rush.1 b/doc/rush.1 index 89e069a..db78056 100644 --- a/doc/rush.1 +++ b/doc/rush.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.9 .\" -.TH "rush" "1" "January 2024" "Version 0.7.13" "Personal package manager." +.TH "rush" "1" "February 2024" "Version 0.7.13" "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 a495739..6be201e 100644 --- a/doc/rush.md +++ b/doc/rush.md @@ -1,6 +1,6 @@ % rush(1) Version 0.7.13 | Personal package manager. % Danny Ben Shitrit \ -% January 2024 +% February 2024 NAME ================================================== diff --git a/rush b/rush index 1e73f24..3e23d30 100755 --- a/rush +++ b/rush @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# This script was generated by bashly 1.1.6 (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 @@ -1259,34 +1259,38 @@ send_completions() { echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'remove\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur" )' + 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 $'' - echo $' \'update\'*)' + echo $' \'search\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'upload\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --chmod --help --message -a -h -m -x")" -- "$cur" )' - echo $' ;;' - echo $'' echo $' \'config\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur" )' echo $' ;;' 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 $' \'upload\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --chmod --help --message -a -h -m -x")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'search\'*)' + echo $' \'update\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' + echo $' \'remove\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur" )' + echo $' ;;' + echo $'' echo $' \'clone\'*)' 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 $'' + echo $' \'edit\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' + echo $' ;;' + echo $'' echo $' \'pull\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' @@ -1295,6 +1299,10 @@ send_completions() { echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --chmod --help --message -a -h -m -x")" -- "$cur" )' 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 $' ;;' + 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 $' ;;' @@ -1311,64 +1319,56 @@ send_completions() { echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur" )' echo $' ;;' 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 $'' - echo $' \'show\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' + 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 $'' echo $' \'add\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' 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 $' ;;' - 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 $'' - echo $' \'a\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' - echo $' ;;' - echo $'' - echo $' \'r\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur" )' + echo $' \'e\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'p\'*)' + echo $' \'s\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'c\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur" )' + echo $' \'l\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur" )' 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 $' \'i\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' 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 $' ;;' echo $'' - echo $' \'i\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' + 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 $' ;;' echo $'' - echo $' \'l\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur" )' + echo $' \'c\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'s\'*)' + echo $' \'p\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' 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 $' \'r\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur" )' + echo $' ;;' + echo $'' + echo $' \'a\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' echo $' *)' @@ -1421,7 +1421,6 @@ rush_remove_command() { # :command.function rush_clone_command() { # src/clone_command.sh - # Collect variables path=${args[path]} repo_id=${args[github_user]} use_ssh=${args[--ssh]} @@ -1436,20 +1435,16 @@ rush_clone_command() { repo_name=${args[--name]:-$default_repo_name} fi - # Adjust repo_id - defaults to $user/rush-repo [[ $repo_id = */* ]] || repo_id="$repo_id/rush-repo" - # Set clone URL - ssh or https? if [[ $use_ssh ]]; then repo_url=git@github.com:$repo_id.git else repo_url=https://github.com/$repo_id.git fi - # Set default path if not provided [[ $path ]] || path="$RUSH_ROOT/$repo_id" - # Abort if target directory exists if [[ -d $path ]]; then if [[ $ignore ]]; then skip=1 @@ -1458,7 +1453,6 @@ rush_clone_command() { fi fi - # Abort if a repository with this name already exists if config_has_key "$repo_name"; then if [[ $ignore ]]; then skip=1 @@ -1471,7 +1465,6 @@ rush_clone_command() { say "clone" "skipping $repo_name (exists)" else - # Clone say "clone" "$repo_url" if [[ $shallow ]]; then @@ -1480,7 +1473,6 @@ rush_clone_command() { git clone "$repo_url" "$path" fi - # Save config config_set "$repo_name" "$path" fi @@ -1580,11 +1572,9 @@ rush_config_command() { # :command.function rush_default_command() { # src/default_command.sh - # Collect variables repo=${args[repo]} repo_path=$(config_get "$repo") - # Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" config_set "default" "$repo_path" @@ -1595,7 +1585,6 @@ rush_default_command() { # :command.function rush_get_command() { # src/get_command.sh - # Collect variables package=${args[package]} repo="default" clone=${args[--clone]} @@ -1616,12 +1605,10 @@ rush_get_command() { package_path=$repo_path/$package script=$package_path/main - # Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" [[ -f $script ]] || abort "script not found: $script" - # Run the script (make it executable if it isnt first) export REPO="$repo" export REPO_PATH="$repo_path" [[ -z "$USER_CWD" ]] && export USER_CWD="$PWD" @@ -1650,7 +1637,6 @@ rush_get_command() { # :command.function rush_undo_command() { # src/undo_command.sh - # Collect variables package=${args[package]} repo="default" [[ -n "${args['--verbose']}" ]] && export VERBOSE=1 @@ -1664,12 +1650,10 @@ rush_undo_command() { package_path=$repo_path/$package script=$package_path/undo - # Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" [[ -f $script ]] || abort "script not found: $script" - # Run the script (make it executable if it isnt first) export REPO="$repo" export REPO_PATH="$repo_path" [[ -z "$USER_CWD" ]] && export USER_CWD="$PWD" @@ -1698,7 +1682,6 @@ rush_undo_command() { # :command.function rush_snatch_command() { # src/snatch_command.sh - # Collect variables repo_id=${args[github_user]} package=${args[package]} undo=${args[--undo]} @@ -1784,7 +1767,6 @@ rush_copy_command() { # :command.function rush_info_command() { # src/info_command.sh - # Collect variables package=${args[package]} repo="default" @@ -1797,7 +1779,6 @@ rush_info_command() { package_path="$repo_path/$package" infofile="$package_path/info" - # Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" [[ -f $infofile ]] || abort "infofile not found: $infofile" @@ -1905,16 +1886,13 @@ rush_search_command() { repo_path=$(config_get "$repo") - # Add "repo:" to the result unless it is the default prefix='' [[ "$repo" != "default" ]] && prefix="$repo:" - # Search directories matching search text blue "Matching packages:\n" find "$repo_path" -type d -not -path '*/\.*' | grep --color=always "$text" | sed "s#${repo_path}/#${prefix}#g" | sed 's#/info##' - # Search info files matching search text blue "\nMatching info files:\n" grep --color=always --initial-tab --recursive --ignore-case --include "info" \ "$text" "$repo_path" | @@ -1939,7 +1917,6 @@ rush_search_command() { # :command.function rush_edit_command() { # src/edit_command.sh - # Collect variables package=${args[package]} file=${args[file]:-main} repo="default" @@ -1954,12 +1931,10 @@ rush_edit_command() { package_path="$repo_path/$package" file_path="$package_path/$file" - # Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" [[ -f $file_path ]] || abort "file not found: $file_path" - # Edit the file "$edit" "$file_path" } @@ -1967,7 +1942,6 @@ rush_edit_command() { # :command.function rush_show_command() { # src/show_command.sh - # Collect variables package=${args[package]} file=${args[file]} repo="default" @@ -1981,11 +1955,9 @@ rush_show_command() { package_path="$repo_path/$package" file_path="$package_path/$file" - # Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" - # Show the package data if [[ $file ]]; then [[ -f $file_path ]] || abort "file not found: $file_path" cat "$file_path" @@ -2235,11 +2207,9 @@ rush_add_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['repo']+x} ]]; then - args['repo']=$1 shift elif [[ -z ${args['path']+x} ]]; then - args['path']=$1 shift else @@ -2306,7 +2276,6 @@ rush_remove_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['repo']+x} ]]; then - args['repo']=$1 shift else @@ -2381,7 +2350,6 @@ rush_clone_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args['--name']="$2" shift shift @@ -2416,11 +2384,9 @@ rush_clone_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['github_user']+x} ]]; then - args['github_user']=$1 shift elif [[ -z ${args['path']+x} ]]; then - args['path']=$1 shift else @@ -2484,7 +2450,6 @@ rush_pull_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['repo']+x} ]]; then - args['repo']=$1 shift else @@ -2545,7 +2510,6 @@ rush_push_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args['--message']="$2" shift shift @@ -2572,7 +2536,6 @@ rush_push_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['repo']+x} ]]; then - args['repo']=$1 shift else @@ -2677,7 +2640,6 @@ rush_default_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['repo']+x} ]]; then - args['repo']=$1 shift else @@ -2756,7 +2718,6 @@ rush_get_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['package']+x} ]]; then - args['package']=$1 shift else @@ -2819,7 +2780,6 @@ rush_undo_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['package']+x} ]]; then - args['package']=$1 shift else @@ -2898,11 +2858,9 @@ rush_snatch_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['github_user']+x} ]]; then - args['github_user']=$1 shift elif [[ -z ${args['package']+x} ]]; then - args['package']=$1 shift else @@ -2969,11 +2927,9 @@ rush_copy_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['source_package']+x} ]]; then - args['source_package']=$1 shift elif [[ -z ${args['target_package']+x} ]]; then - args['target_package']=$1 shift else @@ -3029,7 +2985,6 @@ rush_info_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['package']+x} ]]; then - args['package']=$1 shift else @@ -3100,7 +3055,6 @@ rush_list_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['repo_or_package']+x} ]]; then - args['repo_or_package']=$1 shift else @@ -3150,7 +3104,6 @@ rush_search_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['text']+x} ]]; then - args['text']=$1 shift else @@ -3206,11 +3159,9 @@ rush_edit_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['package']+x} ]]; then - args['package']=$1 shift elif [[ -z ${args['file']+x} ]]; then - args['file']=$1 shift else @@ -3269,11 +3220,9 @@ rush_show_parse_requirements() { # :command.parse_requirements_case # :command.parse_requirements_case_simple if [[ -z ${args['package']+x} ]]; then - args['package']=$1 shift elif [[ -z ${args['file']+x} ]]; then - args['file']=$1 shift else diff --git a/src/clone_command.sh b/src/clone_command.sh index a2e7b8f..6c2bd40 100644 --- a/src/clone_command.sh +++ b/src/clone_command.sh @@ -1,4 +1,4 @@ -# Collect variables +## Collect variables path=${args[path]} repo_id=${args[github_user]} use_ssh=${args[--ssh]} @@ -13,20 +13,20 @@ else repo_name=${args[--name]:-$default_repo_name} fi -# Adjust repo_id - defaults to $user/rush-repo +## Adjust repo_id - defaults to $user/rush-repo [[ $repo_id = */* ]] || repo_id="$repo_id/rush-repo" -# Set clone URL - ssh or https? +## Set clone URL - ssh or https? if [[ $use_ssh ]]; then repo_url=git@github.com:$repo_id.git else repo_url=https://github.com/$repo_id.git fi -# Set default path if not provided +## Set default path if not provided [[ $path ]] || path="$RUSH_ROOT/$repo_id" -# Abort if target directory exists +## Abort if target directory exists if [[ -d $path ]]; then if [[ $ignore ]]; then skip=1 @@ -35,7 +35,7 @@ if [[ -d $path ]]; then fi fi -# Abort if a repository with this name already exists +## Abort if a repository with this name already exists if config_has_key "$repo_name"; then if [[ $ignore ]]; then skip=1 @@ -48,7 +48,7 @@ if [[ $skip ]]; then say "clone" "skipping $repo_name (exists)" else - # Clone + ## Clone say "clone" "$repo_url" if [[ $shallow ]]; then @@ -57,7 +57,7 @@ else git clone "$repo_url" "$path" fi - # Save config + ## Save config config_set "$repo_name" "$path" fi diff --git a/src/default_command.sh b/src/default_command.sh index 5affcd2..55155e4 100644 --- a/src/default_command.sh +++ b/src/default_command.sh @@ -1,8 +1,8 @@ -# Collect variables +## Collect variables repo=${args[repo]} repo_path=$(config_get "$repo") -# Verify we have everything we need +## Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" config_set "default" "$repo_path" diff --git a/src/edit_command.sh b/src/edit_command.sh index f15e9e8..226c5f4 100644 --- a/src/edit_command.sh +++ b/src/edit_command.sh @@ -1,4 +1,4 @@ -# Collect variables +## Collect variables package=${args[package]} file=${args[file]:-main} repo="default" @@ -13,10 +13,10 @@ repo_path=$(config_get "$repo") package_path="$repo_path/$package" file_path="$package_path/$file" -# Verify we have everything we need +## Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" [[ -f $file_path ]] || abort "file not found: $file_path" -# Edit the file +## Edit the file "$edit" "$file_path" diff --git a/src/get_command.sh b/src/get_command.sh index 14325cf..38ef7c7 100644 --- a/src/get_command.sh +++ b/src/get_command.sh @@ -1,4 +1,4 @@ -# Collect variables +## Collect variables package=${args[package]} repo="default" clone=${args[--clone]} @@ -19,12 +19,12 @@ repo_path=$(config_get "$repo") package_path=$repo_path/$package script=$package_path/main -# Verify we have everything we need +## Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" [[ -f $script ]] || abort "script not found: $script" -# Run the script (make it executable if it isnt first) +## Run the script (make it executable if it isn't first) export REPO="$repo" export REPO_PATH="$repo_path" [[ -z "$USER_CWD" ]] && export USER_CWD="$PWD" diff --git a/src/info_command.sh b/src/info_command.sh index 04e707f..838f29c 100644 --- a/src/info_command.sh +++ b/src/info_command.sh @@ -1,4 +1,4 @@ -# Collect variables +## Collect variables package=${args[package]} repo="default" @@ -11,7 +11,7 @@ repo_path=$(config_get "$repo") package_path="$repo_path/$package" infofile="$package_path/info" -# Verify we have everything we need +## Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" [[ -f $infofile ]] || abort "infofile not found: $infofile" diff --git a/src/lib/send_completions.sh b/src/lib/send_completions.sh index ddad8c1..94de39e 100644 --- a/src/lib/send_completions.sh +++ b/src/lib/send_completions.sh @@ -42,34 +42,38 @@ send_completions() { echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'remove\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur" )' + 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 $'' - echo $' \'update\'*)' + echo $' \'search\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'upload\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --chmod --help --message -a -h -m -x")" -- "$cur" )' - echo $' ;;' - echo $'' echo $' \'config\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur" )' echo $' ;;' 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 $' \'upload\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --chmod --help --message -a -h -m -x")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'search\'*)' + echo $' \'update\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' + echo $' \'remove\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur" )' + echo $' ;;' + echo $'' echo $' \'clone\'*)' 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 $'' + echo $' \'edit\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' + echo $' ;;' + echo $'' echo $' \'pull\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' @@ -78,6 +82,10 @@ send_completions() { echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --chmod --help --message -a -h -m -x")" -- "$cur" )' 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 $' ;;' + 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 $' ;;' @@ -94,64 +102,56 @@ send_completions() { echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur" )' echo $' ;;' 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 $'' - echo $' \'show\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' + 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 $'' echo $' \'add\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' 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 $' ;;' - 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 $'' - echo $' \'a\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' - echo $' ;;' - echo $'' - echo $' \'r\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur" )' + echo $' \'e\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'p\'*)' + echo $' \'s\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'c\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur" )' + echo $' \'l\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur" )' 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 $' \'i\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' 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 $' ;;' echo $'' - echo $' \'i\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --help -h")" -- "$cur" )' + 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 $' ;;' echo $'' - echo $' \'l\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --help --simple -a -h -s")" -- "$cur" )' + echo $' \'c\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--edit --help -e -h")" -- "$cur" )' echo $' ;;' echo $'' - echo $' \'s\'*)' + echo $' \'p\'*)' echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' 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 $' \'r\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--help --purge -h -p")" -- "$cur" )' + echo $' ;;' + echo $'' + echo $' \'a\'*)' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "$(_rush_completions_filter "--help -h")" -- "$cur" )' echo $' ;;' echo $'' echo $' *)' diff --git a/src/search_command.sh b/src/search_command.sh index e613ea2..c5fabae 100644 --- a/src/search_command.sh +++ b/src/search_command.sh @@ -5,16 +5,16 @@ search_repo() { repo_path=$(config_get "$repo") - # Add "repo:" to the result unless it is the default + ## Add "repo:" to the result unless it is the default prefix='' [[ "$repo" != "default" ]] && prefix="$repo:" - # Search directories matching search text + ## Search directories matching search text blue "Matching packages:\n" find "$repo_path" -type d -not -path '*/\.*' | grep --color=always "$text" | sed "s#${repo_path}/#${prefix}#g" | sed 's#/info##' - # Search info files matching search text + ## Search info files matching search text blue "\nMatching info files:\n" grep --color=always --initial-tab --recursive --ignore-case --include "info" \ "$text" "$repo_path" | diff --git a/src/show_command.sh b/src/show_command.sh index b7745f2..9477e6e 100644 --- a/src/show_command.sh +++ b/src/show_command.sh @@ -1,4 +1,4 @@ -# Collect variables +## Collect variables package=${args[package]} file=${args[file]} repo="default" @@ -12,11 +12,11 @@ repo_path=$(config_get "$repo") package_path="$repo_path/$package" file_path="$package_path/$file" -# Verify we have everything we need +## Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" -# Show the package data +## Show the package data if [[ $file ]]; then [[ -f $file_path ]] || abort "file not found: $file_path" cat "$file_path" diff --git a/src/snatch_command.sh b/src/snatch_command.sh index 2d00d9c..f98a6f6 100644 --- a/src/snatch_command.sh +++ b/src/snatch_command.sh @@ -1,4 +1,4 @@ -# Collect variables +## Collect variables repo_id=${args[github_user]} package=${args[package]} undo=${args[--undo]} diff --git a/src/undo_command.sh b/src/undo_command.sh index 1d030ac..8767ae7 100644 --- a/src/undo_command.sh +++ b/src/undo_command.sh @@ -1,4 +1,4 @@ -# Collect variables +## Collect variables package=${args[package]} repo="default" [[ -n "${args['--verbose']}" ]] && export VERBOSE=1 @@ -12,12 +12,12 @@ repo_path=$(config_get "$repo") package_path=$repo_path/$package script=$package_path/undo -# Verify we have everything we need +## Verify we have everything we need [[ $repo_path ]] || abort "repo not found: $repo" [[ -d $package_path ]] || abort "package not found: $repo:$package" [[ -f $script ]] || abort "script not found: $script" -# Run the script (make it executable if it isnt first) +## Run the script (make it executable if it isn't first) export REPO="$repo" export REPO_PATH="$repo_path" [[ -z "$USER_CWD" ]] && export USER_CWD="$PWD"