-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
within fish I'm heaviliy using drush, a shell extension for the Drupal
CMS with a lot of options that are also sometimes context sensitive.
For bash, the drush package contains a drush.complete.sh which can be
sourced for terminal sessions. That looks like this:
=================== START ============
# Completion function, uses the "drush complete" command to retrieve
# completions for a specific command line COMP_WORDS.
_drush_completion() {
# Set IFS to newline (locally), since we only use newline
separators, and
# need to retain spaces (or not) after completions.
local IFS=$'\n'
# The '< /dev/null' is a work around for a bug in php libedit stdin
handling.
# Note that libedit in place of libreadline in some distributions. See:
# https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214
COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}"
< /dev/null 2> /dev/null) )
}
# Register our completion function. We include common short aliases
for Drush.
complete -o bashdefault -o default -o nospace -F _drush_completion d
dr drush drush5 drush6 drush7 drush.php
=================== FINISH ============
I'm trying to port this to fish and came as long as this:
complete -x -c drush -d "Dr" -a "(drush --early=includes/complete.inc)"
This is working to a certain extend such that it displays all options
almost all of the time. What I need is to provide the specific command
line COMP_WORDS to the script complete.inc. What is the right syntax
for that? I looked into variable expansion but could figure it out.
Once that's complete I should also define the local variable IFS=$'\n'
and I'd appreciate if anyone could give me a hint on how to get all of
this into a single command or a function for the fish shell.
Thanks in advance.
Jürgen
- --
http://www.paragon-es.de
http://about.me/jurgenhaas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBAgAGBQJUZNLWAAoJEGMwkysX8CInBpoH/2ERD/eChnxUrKnbuoSldQzg
jfrT3vsQHiXWzZDXPEcM97sBeacUV3211sCB5SdftFKI+AVhc9Nl15oadmA2w+Fp
a96HW54NiUE4E6l4ULfYVO79zixGxxQewV3jo+3Y1SHkUSbyq3EYCrZYemiOyxRN
8DfeBIvQrtrLVPLuAZqXSCWtuwDCwgWnmnSdDrGWC4VkL7gUBBIf3KPDyZu4bCKm
oBSzov4XFGTPcSICcvJy0ZEMusz3oOXYpAuxzsM81wMgPZDCMUQF2xU0njg04Pzq
euHuTGzhOG22HTK9MmMjmJmR9Qz5BhUeYyOo7ayCYCuWrDW4pTnCYTJr1XEaHoM=
=4LlP
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users