By writing the README first we can explore different
approaches to the user experience of our CLI. We
could think through the entire CLI right now, but we'll
leave other subcommands for later. Instead, we'll focus
on the fact that we know we will have multiple subcommands
and design the command on which all others rely: write
.
We can come up with a first example subcommand. Note that
by doing this we are also defining the name of the binary
as garden
.
garden write
When writing, users will not necessarily know the title of
what they're writing in advance, so we will not require
them to provide it. This leads us to an optional title
argument. We could have chosen to make this a positional
argument, but we made it a flag instead to delineate from
other potential future positional arguments (such as
--message
, which we have chosen not to implement now).
garden write -t "Writing about Rust"