check gem edit command availability
This commit is contained in:
parent
6c7e9527d6
commit
aaff6c94ef
8
src/_gem
8
src/_gem
|
@ -28,6 +28,11 @@ _gem() {
|
||||||
$nul_arg
|
$nul_arg
|
||||||
)
|
)
|
||||||
|
|
||||||
|
local gem_edit_command
|
||||||
|
|
||||||
|
ruby -rgemedit -e 'true' >/dev/null 2>&1 &&
|
||||||
|
gem_edit_command="edit[Edit installed gem in editor]"
|
||||||
|
|
||||||
if (( CURRENT > 2 )); then
|
if (( CURRENT > 2 )); then
|
||||||
(( CURRENT-- ))
|
(( CURRENT-- ))
|
||||||
shift words
|
shift words
|
||||||
|
@ -40,7 +45,7 @@ _gem() {
|
||||||
"cleanup[Clean up old versions of installed gems in the local repository]" \
|
"cleanup[Clean up old versions of installed gems in the local repository]" \
|
||||||
"contents[Display the contents of the installed gems]" \
|
"contents[Display the contents of the installed gems]" \
|
||||||
"dependency[Show the dependencies of an installed gem]" \
|
"dependency[Show the dependencies of an installed gem]" \
|
||||||
"edit[Edit installed gem in editor]" \
|
${gem_edit_command} \
|
||||||
"environment[Display information about the RubyGems environment]" \
|
"environment[Display information about the RubyGems environment]" \
|
||||||
"fetch[Download a gem and place it in the current directory]" \
|
"fetch[Download a gem and place it in the current directory]" \
|
||||||
"generate_index[Generates the index files for a gem server directory]" \
|
"generate_index[Generates the index files for a gem server directory]" \
|
||||||
|
@ -85,6 +90,7 @@ __gem_help_arguments() {
|
||||||
"cleanup"
|
"cleanup"
|
||||||
"contents"
|
"contents"
|
||||||
"dependency"
|
"dependency"
|
||||||
|
$(_call_program commands "ruby -rgemedit -e 'print \"edit\"' 2>/dev/null")
|
||||||
"environment"
|
"environment"
|
||||||
"fetch"
|
"fetch"
|
||||||
"generate_index"
|
"generate_index"
|
||||||
|
|
Loading…
Reference in New Issue