blog Sharing notes with the internet
Posts with the tag bash,:

Bash Incremental Directory Completion

I was just working on a bash completion for my repo management tool (link) and came across a completion problem I couldn't find an answer to. In my tool, all repositories are stored under a root source directory ~/src, and are three directories deep under that. The top directory is the website, the second is the user, and the third is the repo itself. For example My tool repo has a command repo cd <spec>, which will try to find a project matching the path you specify.