From 596533a15dde5592893ce65d125fc491b87543ff Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 21 Sep 2024 22:44:27 +0900 Subject: [PATCH] gem: complete `unpack` --- completion-gem | 2 +- tests/completion-gem/test.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/completion-gem b/completion-gem index e8dd330..06d3d9f 100644 --- a/completion-gem +++ b/completion-gem @@ -64,7 +64,7 @@ __gem() { return;; uninstall | cleanup) choices=$(__gem_installed_gems);; - push) + push | unpack) type -t _filedir >/dev/null && _filedir gem return;; esac diff --git a/tests/completion-gem/test.sh b/tests/completion-gem/test.sh index 5e8e594..fcecdf4 100755 --- a/tests/completion-gem/test.sh +++ b/tests/completion-gem/test.sh @@ -70,3 +70,15 @@ begin-test 'should offer command-specific options' reject --strict ) end-test + +begin-test 'after unpack should suggest local .gem files' +( + touch foo.rb foo.gem foo.gemspec + + test-completion gem unpack f + expect foo.gem + reject foo.rb foo.gemspec + + rm -f foo.rb foo.gem foo.gemspec +) +end-test