You can try this function to make completions for aliases:

                   function make_completion --argument-names alias command
                       echo "
                       function __alias_completion_$alias
                           set -l cmd (commandline -o)
                           set -e cmd[1]
                           complete -C\"$command \$cmd\"
                       end
                       " | .
                       complete -c $alias -a "(__alias_completion_$alias)"
                   end

use it as follows:
> make_completion aptin "sudo apt-get install"

I do not have aptitude and checked it on pacman:
> make_completion pacs 'pacman -S'
does the job.

The function creates function which calls 'complete -C' for the specified  
commandline with alias name substituted.

Maxim


On Thu, 24 Jan 2013 02:48:47 +0400, Mark Skilbeck <m...@iammark.us> wrote:

> Aw, yuck. Here's to a better future... *cheers*.
>
> On Wed, Jan 23, 2013 at 01:30:27PM -0800, ridiculous_fish wrote:
>> Not yet, but it's highly desired:  
>> https://github.com/fish-shell/fish-shell/issues/393
>>
>>
>> On Jan 22, 2013, at 12:58 AM, Mark Skilbeck <m...@iammark.us> wrote:
>>
>> > Hi, all.
>> >
>> > In bash, one can provide completions for aliased commands. For
>> > example, I could have:
>> >
>> >    alias aptin="sudo apt-get install"
>> >
>> > provide apt-get install's completions for the command aptin. Clearly
>> > this is a huge time-saver.
>> >
>> > Is the same possible in Fish? Please say yes!
>> >
>> > -mgsk
>> >
>> >  
>> ------------------------------------------------------------------------------
>> > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>> > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills  
>> current
>> > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>> > MVPs and experts. ON SALE this month only -- learn more at:
>> > http://p.sf.net/sfu/learnnow-d2d
>> > _______________________________________________
>> > Fish-users mailing list
>> > Fish-users@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/fish-users
>> >
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnnow-d2d
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to