mbrubeck / compleat

Generate command-line completions using a simple DSL.

Home Page:http://limpet.net/mbrubeck/2009/10/30/compleat.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble with sudo completion.

sorin-ionescu opened this issue · comments

BASH completion for "sudo foo" works as expected when the "foo" completion is provided by the bash_completion package or written manually with the BASH completion API.

However, it refuses to work for completions generated by Compleat.
sudo open[tab] results in the error bellow:

sudo open -bash: compgen: warning: -C option may not work as you expect
compleat: : openFile: does not exist (No such file or directory)
/Users/sorin/.compleat/open.usage

This is my open.usage for the Mac OS X open command:
open [-a (|) | -b | -e | -t | -R | --reveal | -f];
open [-a ] [-g | --background | -n | --new | -W | --wait-apps] [--args] ;
open [-h | --header ];
application = !mdfind 'kMDItemKind == Application' | awk 'BEGIN {FS=OFS="/"} {print $NF}' | sed 's/ /\ /g';
identifier = !mdfind 'kMDItemKind == Application' | sed -e 's/ /\ /g' -e "s:':\':g" | xargs -n 1 mdls | grep 'kMDItemCFBundleIdentifier' | cut -d '=' -f 2 | sed 's/^ "(.*)"$/\1/g'

I forgot to mention that despite what Compleat says, the file exists. It works fine when "sudo" is not prepended.

Thanks for the report! This is definitely a bug in compleat, and I'll try to fix it. Thanks for the open.usage file, too.

Thank you. If you are also on Mac, could you please provide a binary download? Thank you. Compleat is awesome.