Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: compctl -l



On Oct 15, 11:37am, DervishD wrote:
}
}     Definitely, if you ever come to Spain, I owe you a good dinner ;))

I'll keep that in mind.

} >     compctl -l '' nohup noglob exec nice eval - time rusage
} 
}     Yes, this is another clear use I understood. The '-' doesn't
} confuse compctl?

It might confuse it if it were written in this order:

    compctl -l '' - nohup noglob exec nice eval time rusage

Once compctl begins parsing the list of command names, though, it won't
change back to parsing options, so "-" is just another command name in
the previous excerpt.

} > "compctl -x ... -l ..." is the real meat
} 
} What confused me is the documentation about -l:

That documentation was written by another non-native English speaker,
so perhaps a bit is lost in the double translation.

}     -l CMD
}         This option restricts the range of command line words that
} are considered to be arguments. [...] . Completion is then performed
} as if these had been given as arguments to the CMD supplied with the
} option.
} 
}     IMHO, this option doesn't really restricts what in the command
} line is an argument :???

When CMD is the empty string, it does.  In that case, the arguments are
restricted to words 2 through the end (with the original command name
as word zero), and word 1, which would normally be an argument, is a
command name.

However, you're right that this is badly worded in the case where CMD
is not empty.  It restricts the words considered to be arguments to
exactly the same set as before they were restricted, but changes the
interpretation of the word in command position.

I may be misremembering, but I think originally -l didn't have any
argument and always worked like the usage with an empty argument.  The
doc thus was written for that case and then mutated to cover the other.

} Well, I must admit that my completion knowledge is worse than my
} english, but I don't get the meaning of that... The completion is
} performed in two ways: command-like or using 'CMD' completion :??

It's trying to get across the notion that one word is completed as a
command name (using "compctl -C") and then the rest of the words are
completed as arguments of whatever command the first word names.  It's
describing what happens with different cursor placements at the time
completion is invoked.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author