CHAPTER 15Writing Completion Functions

In Chapter 10 we showed how you can take advantage of the completion systems of bash and zsh. This included fairly advanced techniques for configuring their behavior. In this chapter, we build on this, with some more advanced ways to configure completion. The bulk of this chapter however, pertains to writing your own completion functions. In particular, we cover the following topics:

  • Specifying simple definitions to enable the shell to complete the arguments of a particular command
  • Writing a function, either for bash or zsh, to handle completion for a particular command
  • Making use of the many zsh functions that allow you to do powerful things easily in your completion functions
  • Associating descriptions ...

Get From Bash to Z Shell: Conquering the Command Line now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.