From 9dd76fb6bc29071bd616d9ea32e29ce7b4dcba73 Mon Sep 17 00:00:00 2001 From: spacewander Date: Fri, 23 Sep 2016 12:02:23 +0800 Subject: add task description to fabric completion --- plugins/fabric/_fab | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 9628e1224..79d596ed6 100644 --- a/plugins/fabric/_fab +++ b/plugins/fabric/_fab @@ -5,7 +5,10 @@ local curcontext=$curcontext state line declare -A opt_args declare target_list -target_list=(`fab --shortlist 2>/dev/null`) +IFS="$(printf '\n+')" target_list=($(fab -l | awk '{ + if(NR > 2) + printf "%s:%s\n", $1, substr($0, index($0, $2)) +}' 2>/dev/null)) _targets() { _describe -t commands "fabric targets" target_list -- cgit v1.2.3-70-g09d2 From 40df67bc3b9b51caa24df5d220487043040d1f9a Mon Sep 17 00:00:00 2001 From: Tim <0xTim@users.noreply.github.com> Date: Tue, 22 Oct 2019 17:24:05 +0100 Subject: swiftpm: update completion for Swift 5.1 (#8248) --- plugins/swiftpm/README.md | 2 +- plugins/swiftpm/_swift | 190 ++++++++++++++++++++++++---------------------- 2 files changed, 100 insertions(+), 92 deletions(-) (limited to 'plugins') diff --git a/plugins/swiftpm/README.md b/plugins/swiftpm/README.md index 291458511..a722c03e4 100644 --- a/plugins/swiftpm/README.md +++ b/plugins/swiftpm/README.md @@ -2,7 +2,7 @@ ## Description -This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.0. +This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.1. To start using it, add the `swiftpm` plugin to your `plugins` array in `~/.zshrc`: diff --git a/plugins/swiftpm/_swift b/plugins/swiftpm/_swift index 1366b4d9c..fe6f1c9aa 100644 --- a/plugins/swiftpm/_swift +++ b/plugins/swiftpm/_swift @@ -82,13 +82,15 @@ _swift_build() { "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-llbuild-library[Enable building with the llbuild library]" "--force-resolved-versions[]" "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" "--enable-index-store[Enable indexing-while-building feature]" "--disable-index-store[Disable indexing-while-building feature]" "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" "--enable-parseable-module-interfaces[]" + "--trace-resolver[]" + "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: " + "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]" "--build-tests[Build both source and test targets]" "--product[Build the specified product]:Build the specified product: " "--target[Build the specified target]:Build the specified target: " @@ -125,13 +127,15 @@ _swift_run() { "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-llbuild-library[Enable building with the llbuild library]" "--force-resolved-versions[]" "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" "--enable-index-store[Enable indexing-while-building feature]" "--disable-index-store[Disable indexing-while-building feature]" "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" "--enable-parseable-module-interfaces[]" + "--trace-resolver[]" + "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: " + "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]" "--skip-build[Skip building the executable product]" "--build-tests[Build both source and test targets]" "--repl[Launch Swift REPL for the package]" @@ -166,13 +170,15 @@ _swift_package() { "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-llbuild-library[Enable building with the llbuild library]" "--force-resolved-versions[]" "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" "--enable-index-store[Enable indexing-while-building feature]" "--disable-index-store[Disable indexing-while-building feature]" "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" "--enable-parseable-module-interfaces[]" + "--trace-resolver[]" + "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: " + "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]" '(-): :->command' '(-)*:: :->arg' ) @@ -181,49 +187,61 @@ _swift_package() { (command) local modes modes=( - 'update:Update package dependencies' + 'completion-tool:Completion tool (for shell completions)' + 'dump-package:Print parsed Package.swift as JSON' 'describe:Describe the current package' - 'resolve:Resolve package dependencies' - 'tools-version:Manipulate tools version of the current package' - 'unedit:Remove a package from editable mode' + 'clean:Delete build artifacts' 'show-dependencies:Print the resolved dependency graph' + 'init:Initialize a new package' + 'unedit:Remove a package from editable mode' + 'tools-version:Manipulate tools version of the current package' 'fetch:' - 'dump-package:Print parsed Package.swift as JSON' + 'resolve:Resolve package dependencies' + 'reset:Reset the complete cache/build directory' + 'generate-xcodeproj:Generates an Xcode project' 'edit:Put a package in editable mode' 'config:Manipulate configuration of the package' - 'completion-tool:Completion tool (for shell completions)' - 'clean:Delete build artifacts' - 'generate-xcodeproj:Generates an Xcode project' - 'reset:Reset the complete cache/build directory' - 'init:Initialize a new package' + 'update:Update package dependencies' ) _describe "mode" modes ;; (arg) case ${words[1]} in - (update) - _swift_package_update + (completion-tool) + _swift_package_completion-tool + ;; + (dump-package) + _swift_package_dump-package ;; (describe) _swift_package_describe ;; - (resolve) - _swift_package_resolve + (clean) + _swift_package_clean ;; - (tools-version) - _swift_package_tools-version + (show-dependencies) + _swift_package_show-dependencies + ;; + (init) + _swift_package_init ;; (unedit) _swift_package_unedit ;; - (show-dependencies) - _swift_package_show-dependencies + (tools-version) + _swift_package_tools-version ;; (fetch) _swift_package_fetch ;; - (dump-package) - _swift_package_dump-package + (resolve) + _swift_package_resolve + ;; + (reset) + _swift_package_reset + ;; + (generate-xcodeproj) + _swift_package_generate-xcodeproj ;; (edit) _swift_package_edit @@ -231,27 +249,22 @@ _swift_package() { (config) _swift_package_config ;; - (completion-tool) - _swift_package_completion-tool - ;; - (clean) - _swift_package_clean - ;; - (generate-xcodeproj) - _swift_package_generate-xcodeproj - ;; - (reset) - _swift_package_reset - ;; - (init) - _swift_package_init + (update) + _swift_package_update ;; esac ;; esac } -_swift_package_update() { +_swift_package_completion-tool() { + arguments=( + ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}" + ) + _arguments $arguments && return +} + +_swift_package_dump-package() { arguments=( ) _arguments $arguments && return @@ -264,20 +277,23 @@ _swift_package_describe() { _arguments $arguments && return } -_swift_package_resolve() { +_swift_package_clean() { arguments=( - ":The name of the package to resolve:_swift_dependency" - "--version[The version to resolve at]:The version to resolve at: " - "--branch[The branch to resolve at]:The branch to resolve at: " - "--revision[The revision to resolve at]:The revision to resolve at: " ) _arguments $arguments && return } -_swift_package_tools-version() { +_swift_package_show-dependencies() { arguments=( - "--set[Set tools version of package to the given value]:Set tools version of package to the given value: " - "--set-current[Set tools version of package to the current tools version in use]" + "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}" + ) + _arguments $arguments && return +} + +_swift_package_init() { + arguments=( + "--type[empty|library|executable|system-module|manifest]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}" + "--name[Provide custom package name]:Provide custom package name: " ) _arguments $arguments && return } @@ -290,9 +306,10 @@ _swift_package_unedit() { _arguments $arguments && return } -_swift_package_show-dependencies() { +_swift_package_tools-version() { arguments=( - "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}" + "--set[Set tools version of package to the given value]:Set tools version of package to the given value: " + "--set-current[Set tools version of package to the current tools version in use]" ) _arguments $arguments && return } @@ -303,8 +320,30 @@ _swift_package_fetch() { _arguments $arguments && return } -_swift_package_dump-package() { +_swift_package_resolve() { arguments=( + ":The name of the package to resolve:_swift_dependency" + "--version[The version to resolve at]:The version to resolve at: " + "--branch[The branch to resolve at]:The branch to resolve at: " + "--revision[The revision to resolve at]:The revision to resolve at: " + ) + _arguments $arguments && return +} + +_swift_package_reset() { + arguments=( + ) + _arguments $arguments && return +} + +_swift_package_generate-xcodeproj() { + arguments=( + "--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files" + "--enable-code-coverage[Enable code coverage in the generated project]" + "--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files" + "--legacy-scheme-generator[Use the legacy scheme generator]" + "--watch[Watch for changes to the Package manifest to regenerate the Xcode project]" + "--skip-extra-files[Do not add file references for extra files to the generated Xcode project]" ) _arguments $arguments && return } @@ -330,8 +369,8 @@ _swift_package_config() { local modes modes=( 'unset-mirror:Remove an existing mirror' - 'set-mirror:Set a mirror for a dependency' 'get-mirror:Print mirror configuration for the given package dependency' + 'set-mirror:Set a mirror for a dependency' ) _describe "mode" modes ;; @@ -340,12 +379,12 @@ _swift_package_config() { (unset-mirror) _swift_package_config_unset-mirror ;; - (set-mirror) - _swift_package_config_set-mirror - ;; (get-mirror) _swift_package_config_get-mirror ;; + (set-mirror) + _swift_package_config_set-mirror + ;; esac ;; esac @@ -359,14 +398,6 @@ _swift_package_config_unset-mirror() { _arguments $arguments && return } -_swift_package_config_set-mirror() { - arguments=( - "--package-url[The package dependency url]:The package dependency url: " - "--mirror-url[The mirror url]:The mirror url: " - ) - _arguments $arguments && return -} - _swift_package_config_get-mirror() { arguments=( "--package-url[The package dependency url]:The package dependency url: " @@ -374,41 +405,16 @@ _swift_package_config_get-mirror() { _arguments $arguments && return } -_swift_package_completion-tool() { - arguments=( - ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}" - ) - _arguments $arguments && return -} - -_swift_package_clean() { - arguments=( - ) - _arguments $arguments && return -} - -_swift_package_generate-xcodeproj() { - arguments=( - "--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files" - "--enable-code-coverage[Enable code coverage in the generated project]" - "--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files" - "--legacy-scheme-generator[Use the legacy scheme generator]" - "--watch[Watch for changes to the Package manifest to regenerate the Xcode project]" - "--skip-extra-files[Do not add file references for extra files to the generated Xcode project]" - ) - _arguments $arguments && return -} - -_swift_package_reset() { +_swift_package_config_set-mirror() { arguments=( + "--package-url[The package dependency url]:The package dependency url: " + "--mirror-url[The mirror url]:The mirror url: " ) _arguments $arguments && return } -_swift_package_init() { +_swift_package_update() { arguments=( - "--type[empty|library|executable|system-module]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}" - "--name[Provide custom package name]:Provide custom package name: " ) _arguments $arguments && return } @@ -440,13 +446,15 @@ _swift_test() { "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-llbuild-library[Enable building with the llbuild library]" "--force-resolved-versions[]" "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" "--enable-index-store[Enable indexing-while-building feature]" "--disable-index-store[Disable indexing-while-building feature]" "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" "--enable-parseable-module-interfaces[]" + "--trace-resolver[]" + "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: " + "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]" "--skip-build[Skip building the test target]" "(--list-tests -l)"{--list-tests,-l}"[Lists test methods in specifier format]" "--generate-linuxmain[Generate LinuxMain.swift entries for the package]" -- cgit v1.2.3-70-g09d2 From eaa682c0a64daad3138e6f08e7b6c8825700049f Mon Sep 17 00:00:00 2001 From: Lukasz Chrzaszcz Date: Thu, 24 Oct 2019 17:42:33 +0200 Subject: Add profiles documentation --- plugins/profiles/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/profiles/README.md (limited to 'plugins') diff --git a/plugins/profiles/README.md b/plugins/profiles/README.md new file mode 100644 index 000000000..b590a370f --- /dev/null +++ b/plugins/profiles/README.md @@ -0,0 +1,21 @@ +# profiles plugin + +This plugin allows you to create separate configuration files for zsh based +on a domain of your host. + +It takes your `HOST` and looks for files named according to the domain parts +in `$ZSH_CUSTOM/profiles/` directory. + +For example, for `HOST=my.domain.com`, it will try to load the following files: + +```text +$ZSH_CUSTOM/profiles/my.domain.com +$ZSH_CUSTOM/profiles/domain.com +$ZSH_CUSTOM/profiles/com +``` + +To use it, add profiles to the plugins array of your zshrc file: + +```sh +plugins=(... profiles) +``` -- cgit v1.2.3-70-g09d2 From 225425fe091ca052997833279ccc08643818c24a Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 24 Oct 2019 17:56:08 +0200 Subject: Fix target_list creation. Supports fabric 1 and 2 --- plugins/fabric/_fab | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 79d596ed6..89e73e58b 100644 --- a/plugins/fabric/_fab +++ b/plugins/fabric/_fab @@ -4,13 +4,19 @@ local curcontext=$curcontext state line declare -A opt_args -declare target_list -IFS="$(printf '\n+')" target_list=($(fab -l | awk '{ - if(NR > 2) - printf "%s:%s\n", $1, substr($0, index($0, $2)) -}' 2>/dev/null)) +declare -a target_list +target_list=("${(@f)$(fab -l 2>/dev/null | awk '{ + if (NF == 0 || NR == 1) return + if (NF < 2) print $1 + else { + docstring=substr($0, index($0,$2)) + gsub(":", "\\:", docstring) + print $1":"docstring + } +}')}") -_targets() { +_fab_targets() { + [[ -n "$target_list" ]] || return _describe -t commands "fabric targets" target_list } @@ -31,7 +37,7 @@ _arguments -w -S -C \ '(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \ '(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \ '(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \ - "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \ + "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_fab_targets" \ '(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \ '(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \ '(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \ @@ -56,7 +62,7 @@ if [[ CURRENT -ge 1 ]]; then levels) _describe -t commands "output levels" output_levels;; *) - _targets;; + _fab_targets;; esac return -- cgit v1.2.3-70-g09d2 From 4eab95f08a7bd9f5378568a3b7740dae803dcecc Mon Sep 17 00:00:00 2001 From: Anton Balaniuc Date: Fri, 25 Oct 2019 11:59:53 +0100 Subject: mvn: add autocompletion for openliberty (#8244) --- plugins/mvn/mvn.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 01aef814d..0866e5553 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -267,6 +267,8 @@ function listMavenCompletions { stage:copy # toolchain toolchain:toolchain + #liberty + liberty:clean-server liberty:compile-jsp liberty:configure-arquillian liberty:create-server liberty:debug liberty:debug-server liberty:deploy liberty:dev liberty:display-url liberty:dump-server liberty:install-apps liberty:install-feature liberty:install-server liberty:java-dump-server liberty:package-server liberty:run liberty:run-server liberty:server-status liberty:start liberty:start-server liberty:status liberty:stop liberty:stop-server liberty:test-start-server liberty:test-stop-server liberty:undeploy liberty:uninstall-feature # options "-Dmaven.test.skip=true" -DskipTests -DskipITs -Dmaven.surefire.debug -DenableCiProfile "-Dpmd.skip=true" "-Dcheckstyle.skip=true" "-Dtycho.mode=maven" "-Dmaven.test.failure.ignore=true" "-DgroupId=" "-DartifactId=" "-Dversion=" "-Dpackaging=jar" "-Dfile=" -- cgit v1.2.3-70-g09d2 From c1e5cbed5bbefbe09608581d0b47774652221780 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Fri, 25 Oct 2019 13:14:36 +0200 Subject: Fix order and reword some things --- plugins/profiles/README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/profiles/README.md b/plugins/profiles/README.md index b590a370f..5aa1918e2 100644 --- a/plugins/profiles/README.md +++ b/plugins/profiles/README.md @@ -1,21 +1,25 @@ # profiles plugin This plugin allows you to create separate configuration files for zsh based -on a domain of your host. +on your long hostname (including the domain). -It takes your `HOST` and looks for files named according to the domain parts -in `$ZSH_CUSTOM/profiles/` directory. +To use it, add profiles to the plugins array of your zshrc file: -For example, for `HOST=my.domain.com`, it will try to load the following files: +```sh +plugins=(... profiles) +``` + +It takes your `$HOST` variable and looks for files named according to the +domain parts in `$ZSH_CUSTOM/profiles/` directory. + +For example, for `HOST=host.domain.com`, it will try to load the following files, +in this order: ```text -$ZSH_CUSTOM/profiles/my.domain.com -$ZSH_CUSTOM/profiles/domain.com $ZSH_CUSTOM/profiles/com +$ZSH_CUSTOM/profiles/domain.com +$ZSH_CUSTOM/profiles/host.domain.com ``` -To use it, add profiles to the plugins array of your zshrc file: - -```sh -plugins=(... profiles) -``` +This means that if there are conflicting settings on those files, the one to take +precedence will be the last applied, i.e. the one in host.domain.com. -- cgit v1.2.3-70-g09d2 From 36092aac0c3e1979caf4afb9fa9bd2115f404fc4 Mon Sep 17 00:00:00 2001 From: Łukasz Chrząszcz Date: Fri, 25 Oct 2019 13:14:53 +0200 Subject: powder: add README (#8310) --- plugins/powder/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 plugins/powder/README.md (limited to 'plugins') diff --git a/plugins/powder/README.md b/plugins/powder/README.md new file mode 100644 index 000000000..a83b1f2d3 --- /dev/null +++ b/plugins/powder/README.md @@ -0,0 +1,8 @@ +# Powder + +This plugin provides completion for [powder](https://github.com/powder-rb/powder/). + +To use it, add powder to the plugins array of your zshrc file: +``` +plugins=(... powder) +``` -- cgit v1.2.3-70-g09d2 From 9785d24172a8cc558e90dd266e37ef5ffa29aa80 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 25 Oct 2019 11:24:35 +0000 Subject: python: fix and extend pyclean (#7762) Deleting `.mypy_cache` did not work, because the directories were not empty. They contain JSON files instead of compiled byte-code. This extends the cleanup by also getting rid of `.pytest_cache` directories. --- plugins/python/python.plugin.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 950b0e01a..f39cd80b7 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -1,13 +1,14 @@ # Find python file alias pyfind='find . -name "*.py"' -# Remove python compiled byte-code and mypy cache in either current directory or in a -# list of specified directories +# Remove python compiled byte-code and mypy/pytest cache in either the current +# directory or in a list of specified directories (including sub directories). function pyclean() { ZSH_PYCLEAN_PLACES=${*:-'.'} find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete - find ${ZSH_PYCLEAN_PLACES} -type d -name ".mypy_cache" -delete + find ${ZSH_PYCLEAN_PLACES} -depth -type d -name ".mypy_cache" -exec rm -r "{}" + + find ${ZSH_PYCLEAN_PLACES} -depth -type d -name ".pytest_cache" -exec rm -r "{}" + } # Grep among .py files -- cgit v1.2.3-70-g09d2 From e363109a6d3367d8be1dd66f05a38eb38b4257d7 Mon Sep 17 00:00:00 2001 From: Vice Versa <0x7c48@gmail.com> Date: Sun, 27 Oct 2019 18:36:00 +0200 Subject: alias-finder: fix wc numeric conditional (#8251) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Never use `[[` for numeric comparisons, for that, we’ll use `((`. --- plugins/alias-finder/alias-finder.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 2bfaad597..6b8fa66ce 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -14,7 +14,7 @@ alias-finder() { esac done cmd=$(sed 's/[].\|$(){}?+*^[]/\\&/g' <<< $cmd) # adds escaping for grep - if [[ $(wc -l <<< $cmd) == 1 ]]; then + if (( $(wc -l <<< $cmd) == 1 )); then while [[ $cmd != "" ]]; do if [[ $longer = true ]]; then wordStart="'{0,1}" -- cgit v1.2.3-70-g09d2 From 687c50bdf999f8efd45f3c8f578a62329b0633da Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 30 Oct 2019 23:12:45 +0100 Subject: fabric: fix awk "return not in function" error in completion Fixes #8337 --- plugins/fabric/_fab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 89e73e58b..9102dadef 100644 --- a/plugins/fabric/_fab +++ b/plugins/fabric/_fab @@ -6,7 +6,7 @@ declare -A opt_args declare -a target_list target_list=("${(@f)$(fab -l 2>/dev/null | awk '{ - if (NF == 0 || NR == 1) return + if (NF == 0 || NR == 1) next if (NF < 2) print $1 else { docstring=substr($0, index($0,$2)) -- cgit v1.2.3-70-g09d2 From 0ec59e25c7f6ac11d0988082fef908ff753126a2 Mon Sep 17 00:00:00 2001 From: Sudhin MN <34642968+sudhinm@users.noreply.github.com> Date: Tue, 5 Nov 2019 17:57:19 +0530 Subject: fasd: add README (#8334) --- plugins/fasd/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/fasd/README.md (limited to 'plugins') diff --git a/plugins/fasd/README.md b/plugins/fasd/README.md new file mode 100644 index 000000000..1641a92d0 --- /dev/null +++ b/plugins/fasd/README.md @@ -0,0 +1,21 @@ +# fasd + +[`Fasd`](https://github.com/clvv/fasd) (pronounced similar to "fast") is a command-line productivity booster. Fasd offers quick access to files and directories for POSIX shells. + +To use it, add `fasd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fd) +``` + +## Installation + +Please find detailed installation guide [`here`](https://github.com/clvv/fasd#install) + +## Aliases + +| Alias | Command | Description | +|-------|-------------------------------------------|-------------------------------------------------------------| +| v | `fasd -f -e "$EDITOR"` | List frequent/recent files matching the given filename. | +| o | `fasd -a -e xdg-open` | List frequent/recent files and directories matching. | +| j | `fasd_cd -d -i` | cd with interactive selection | \ No newline at end of file -- cgit v1.2.3-70-g09d2 From fc99e6db3e917a0556afe56273c901220c8105a9 Mon Sep 17 00:00:00 2001 From: Eric Dobbs Date: Wed, 6 Nov 2019 12:25:36 -0700 Subject: emacs: support BSD mktemp in emacsclient.sh (#8351) Piping stdin to emacs alias on MacOS was breaking (--tmpdir is not supported in BSD flavored mktemp). Tested in MacOS 10.14 and debian:buster to confirm it still works in linux. --- plugins/emacs/emacsclient.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 26b28d495..0aa8d6f40 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -20,7 +20,8 @@ _emacsfun() # tempfile. (first argument will be `--no-wait` passed in by the plugin.zsh) if [ "$#" -ge "2" -a "$2" = "-" ] then - tempfile="$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)" + tempfile="$(mktemp --tmpdir emacs-stdin-$USER.XXXXXXX 2>/dev/null \ + || mktemp -t emacs-stdin-$USER)" # support BSD mktemp cat - > "$tempfile" _emacsfun --no-wait $tempfile else -- cgit v1.2.3-70-g09d2