Hrm, you said Ubuntu. /usr/share/bash-completion/completions/make exists for me on Ubuntu 14.04. Looks like it's provided by the 'bash-completion' package (version 1:2.1-4). Normally files in /etc/bash_completion.d/ are installed by individual packages for the tools (i.e. the npm package installs /etc/bash_completion.d/npm).
In any case, if you have /etc/bash_completions.d/make and it provides the functionality you want, looking at that should work. -Kevin > On Sep 11, 2014, at 3:53 PM, Mandeep Sandhu <mandeepsandhu....@gmail.com> > wrote: > > I don't have a 'make' file under > /usr/share/bash-completion/completions/ but under > /etc/bash_completion.d/make (maybe a linux/debian thing). > > I'll look into this file. > > > > On Thu, Sep 11, 2014 at 3:02 PM, Kevin Ballard <ke...@sb.org> wrote: >> More specifically, this is defined in >> /usr/share/bash-completion/completions/make and includes a second function >> `_make_target_extract_script` that does a lot of the work. >> >> -Kevin >> >>> On Sep 11, 2014, at 3:00 PM, Kevin Ballard <ke...@sb.org> wrote: >>> >>> It appears bash uses a function called `_make` to do it. `type _make` will >>> print out its definition. >>> >>> -Kevin >>> >>>> On Sep 11, 2014, at 2:49 PM, Mandeep Sandhu <mandeepsandhu....@gmail.com> >>>> wrote: >>>> >>>> Thanks for the info. >>>> >>>> I'm using fish under Ubuntu. Bash on Ubuntu does completion of make >>>> targets from the included *.make files. I'll look into how they do it >>>> and update the fish one if I can. >>>> >>>> -mandeep >>>> >>>> On Thu, Sep 11, 2014 at 2:05 PM, Kevin Ballard <ke...@sb.org> wrote: >>>>> __fish_print_make_targets is a fishscript function defined in the >>>>> standard functions dir $__fish_datadir/functions. In the Fish source, >>>>> this is the folder share/functions. The current implementation is just a >>>>> grep over the first file from the list [GNUmakefile, Makefile, makefile]. >>>>> >>>>> Also, what do you mean by "bash does this"? The stock Bash >>>>> 3.2.51(1)-release included on OS X does not have completion for make. Did >>>>> you install a set of bash completions? In any case, you could look at how >>>>> the bash completion works and update the Fish implementation for the same >>>>> functionality, and then submit a pull request. >>>>> >>>>> -Kevin >>>>> >>>>>> On Sep 10, 2014, at 12:02 PM, Mandeep Sandhu >>>>>> <mandeepsandhu....@gmail.com> wrote: >>>>>> >>>>>> Hi All, >>>>>> >>>>>> I was working on a project which was using makefiles for building a >>>>>> bunch of stuff. >>>>>> >>>>>> This Makefile "includes" a lot of other *.make files from other >>>>>> sub-projects in order to build them. >>>>>> >>>>>> However, I see thast fish can only do completions for the current >>>>>> Makefile targets and doesn't seem to go into the sub-project's *.make >>>>>> files to suggest targets (bash does this). >>>>>> >>>>>> Is this something that that's possible? >>>>>> >>>>>> The current fish completion uses '__fish_print_make_targets' to get >>>>>> the targets. I guess this only looks at Makefile in the current dir? >>>>>> >>>>>> Is this already done in some fish release? Or should I work on adding it? >>>>>> >>>>>> Thanks, >>>>>> -mandeep >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Want excitement? >>>>>> Manually upgrade your production database. >>>>>> When you want reliability, choose Perforce >>>>>> Perforce version control. Predictably reliable. >>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk >>>>>> _______________________________________________ >>>>>> Fish-users mailing list >>>>>> Fish-users@lists.sourceforge.net >>>>>> https://lists.sourceforge.net/lists/listinfo/fish-users >>>>> >>> >>> ------------------------------------------------------------------------------ >>> Want excitement? >>> Manually upgrade your production database. >>> When you want reliability, choose Perforce >>> Perforce version control. Predictably reliable. >>> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk_______________________________________________ >>> Fish-users mailing list >>> Fish-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/fish-users >>
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users