qrush / sub

a delicious way to organize programs
http://37signals.com/svn/posts/3264-automating-with-convention-introducing-sub
MIT License
1.74k stars 148 forks source link

How to autocomplete file paths? #16

Closed bloudermilk closed 11 years ago

bloudermilk commented 11 years ago

One of my commands simply accepts a file path as a parameter but I can't seem to figure out how to re-enable native autocompletion. Is this possible?

bloudermilk commented 11 years ago

Here's the sub in question if it helps: pilot-install.

bloudermilk commented 11 years ago

@qrush would love to get your advice on this!

qrush commented 11 years ago

It doesn't seem like the script linked uses autocompletions at all. Have you read:

https://github.com/37signals/sub#autocompletion

Basically you could have:

# Provide pilot completions
if [ "$1" = "--complete" ]; then
  exec ls
fi
bloudermilk commented 11 years ago

@qrush I've read referenced documentation and successfully implemented autocompletion for a couple commands already. It seems like if I wanted to do a traditional path autocomplete I would need to have access to the partial argument being completed. Is that right?

bloudermilk commented 11 years ago

@qrush not sure if this fell off your radar or you've just been busy...

qrush commented 11 years ago

Yes, both, and I've been on vacation all this week. I'm really not sure of the best way to do this other than what I provided earlier, sorry.

bloudermilk commented 11 years ago

No worries, thanks for your help.

qrush commented 11 years ago

Hey @bloudermilk does #27 work for you?

bloudermilk commented 11 years ago

@qrush yes, thank you!