Choosing Default Values for Flags and Arguments
The existence of flags in an app’s user interface serves our guiding principle of making uncommon things possible, and providing good defaults helps make common things easy. A sensible default communicates your intention of how to use your app, since the default value makes a particular usage of your app very simple (we’ll see how to allow users to customize defaults in Chapter 6, Make Configuration Easy). Let’s see how to decide on good defaults both for the arguments given to flags and for the arguments to our app (see Chapter 2, Be Easy to Use if you need a quick review of the different parts of the command line).
Default Values for Flags
First, you should almost always have a default for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access