On Feb 17, 2008 4:20 PM, Stefano Sabatini <[EMAIL PROTECTED]> wrote: > Hi all fish users, > > I'm facing this problem. > > Suppose I have a command which doesn't take any file or dir argument, > but only supports a certain number of option switches. > > Since I actually found the problem when dealing with the completions > for effectv, I'll use that command as an example. > > I wrote completions for the switches, so when I have in commandline: > complete -f -c effectv -a ' ' -d "video effector" > > [EMAIL PROTECTED] ~> effectv - > -autoplay ([FRAMES] change effects automatically every > FRAMES) > -channel ([CHANNEL] channel number of video source (default is > 0)) > -device ([FILE] use device FILE for video4linux (default is > /dev/video0)) > -doublebuffer (enable double buffering mode (if > possible)) > -fps ([NUMBER] set the scaling. When the capturing size is set, the screen > si…) > -freqtab ([FREQUTAB] set frequency > table) > -fullscreen (enable fullscreen > mode) > -geometry ([WxH] set the size of screen to WxH > pixels) > -hardware (use direct video memory (if > possible)) > -help (show usage > information) > -norm ([NORM] set video norm (default is > ntsc)) > -palette ([PALETTE] set the PALETTE of capturing > device) > -size ([WxH] set the size of capturing image to WxH pixels (default > 320x240)) > -vloopback ([FILE] use device FILE for output of vloopback > device) > > Now effectv is a command which doesn't take filenames, so when I have > in the commandline just "effectv" I would like to see no completions > at all, or just a description of what the command does. > > Instead I get: > [EMAIL PROTECTED] ~> effectv > bin/ (Directory) lib/ (Directory) src/ (Directory) > Desktop/ (Directory) Mail/ (Directory) tmp/ (Directory) > Downloads/ (Directory) News/ (Directory) TODO (File, 660B) > etc/ (Directory) opt/ (Directory) var/ (Directory) > include/ (Directory) share/ (Directory) > > So I tried setting: > complete -c effectv -f -d "video effector" > > or even with: > complete -c effectv -a ' ' -f -d "video effector" > > but still getting the dir completion. > > When I try instead: > complete -c effectv -a 'foo bar' -f -d "noise" > > I get: > [EMAIL PROTECTED] ~> effectv > bar (noise) foo (noise) > > Completion on the directory is also assumed in many of the shipped > completions files (only to name a few: du, xterm, perl, date) which > *doesn't take dir as argument*. > > Do you know some way to deactivate this behaviour, either is it to be > considered like a bug?
Hi. If fish can't find any completions, it falls back to file completions, even if they have been disabled. The reasoning behind this is that if the user asks for a tab completion, he probably knows what he's doing, and we should do our best to find something to complete with. Also, fish does not try to complete any switches unless the user has already entered a '-'. The reasoning here is that switch completions would often get in the way it is somewhat common that there is only one possible completion available, except for switch completions, and that is what you want. It is also very easy to just hit the '-' before tabbing to get the switch completions. One could argue that if the file completions are turned off, then fish should consider completing using switches instead, even if the user has not entered a '-'. Worth considering, though it might be a bit confusing. Axel > > Version used: > [EMAIL PROTECTED] ~> fish --version > fish, version 1.23.0 > > Best regards and many thanks in advance. > > (PS: yes I'm going to post here completions for effectv one I get > through this problem). > -- > Stefano Sabatini > Linux user number 337176 (see http://counter.li.org) > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Fish-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/fish-users > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
