Skip to content

Trouble with sudo completion. #2

@sorin-ionescu

Description

@sorin-ionescu

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions