Find the name of package containing a file, given the file's path
I would like to find the package a file is in with a shell command. Background is, I want to use "rospack cflags-only-I <package-name>" to get a list of directories to look for c++ headers to build ctags for omnicompletion. See this question. Currently I need to set the pwd of the editor to the package dir. Would be nice to get rid of that limitation.