Chapter 16. Coping With the Command Line
Command-line startup options, environment variables, and configuration files are important to many applications, particularly the implementation of servers. There are a number of ways of dealing with program startup and object creation. We'll look at two issues in this chapter: argument parsing and the overall architecture for an application.
This chapter will extend the configuration file handling from Chapter 13, Configuration Files and Persistence, with yet more techniques for command-line programs and the top-level of a server. It will also extend some logging design features from Chapter 14, The Logging and Warning Modules.
In the next chapter, we'll extend these principles to continue looking at a kind of architectural design that we'll call programming in the Large. We'll use the Command design pattern to define software components that can be aggregated without resorting to shell scripts. This is particularly helpful when writing the background...