O'Reilly logo

From Bash to Z Shell: Conquering the Command Line by Peter Stephenson, Jerry Peek, Oliver Kiddle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required