Linux Application Development (paperback) (2nd Edition)

   

26.8. Sample Application

Several of the examples in other chapters of this book use popt for option processing. A simple implementation of grep is on pages 562-567 and robin appears on pages 355-363. Both provide good examples of how popt is used in most applications.

RPM, a popular Linux package management program, makes heavy use of popt's features. Many of its command-line arguments are implemented through popt aliases, which makes RPM an excellent example of how to take advantage of the popt library.[10]. For more information on RPM, see http://www.rpm.org.

[10] popt was originally implemented for RPM, and many of RPM's query options are implemented as simple popt macros.

Logrotate is a program to help manage a system's log files. It provides a simpler example of using popt than RPM does, and is included with most Linux distributions.


       
     

    Категории