It's bothered me for a long time that the completions in fish are made for the GNU version of various commands. For this reason I've started to change the completions of a few of the most common Unix commands (currently done are ls, sed and df) to detect if they are using the GNU version of the command or not. If they aren't, the BSD version is assumed instead.
These versions usually hava a large set of switches in common, but differ in some switches, as well as in the fact that only GNU commands accept GNU-style long switches. Detection is done when the command is first used on the commandline, i.e. when the completions are first loaded. It is done by testing the exit status of 'COMMAND --version'. (Better detection methods are welcome. Keep in mind that testing the output of commands is often tricky, because of localization) Does anyone who is actually using *BSD or OS X feel like pitching in? Should be a nice way to get started with writing fish completions. -- Axel ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
