4.6. Pantry usage shortcuts

4.6.1. Using short options

First, use the short options. For didactic purposes, all the examples in this manual use long-style options with two dashes. However, almost every pantry option is also available in short form. The search options (which search for a particular trait) and the change options (which change the traits of the foods in your result to a new value) have short options that conveniently differ only by their case. Thus, for example, -g searches by group name, and -G changes the group name.

If you need to jog your memory on what option does what, use the --help option.

In addition, when specifying reports, you may specify only the first few letters of the report name--enough letters to unambiguously specify the report name. For example, instead of typing --print names-nuts, you may instead type --print na-nu.

4.6.2. Learn your shell

One of the most powerful aspects of pantry is that you use it from your standard command shell. Shells have a wealth of features, such as history searching and command-line editing, that will speed up your shell usage. This will help you not only in Pantry but in other command-line tools as well. In addition, you can write scripts to automate your usage.

The most popular shell today is bash, which is very featureful. However, the bash documentation is dense and difficult to approach for a newcomer.

For a very well-documented shell that is easier to learn than bash, consider fish, the Friendly Interactive Shell. For a very powerful shell with excellent documentation, try zsh.

To improve your shell usage, I highly recommend getting a copy of From Bash to Z Shell: Conquering the Command Line by Kiddle, Peek, and Stephenson. It clearly explains many of the features of shells, such as command history and completion, that make interactive use much easier and faster. Unlike most texts on shells, this one focuses on interactive use. It is well worth the price.

4.6.3. Learn other Unix utilities

Because you use Pantry from your standard command shell, you can easily combine Pantry with other Unix utilities, in ways that even I cannot anticipate. Most obviously, you will often use Pantry with less so that you may easily scroll through reports. You might also find yourself using sort, cut or even awk. The possibilities are endless.

4.6.4. Use pantry-addTo

Finally, use the pantry-addTo command. It makes keeping track of daily food intake much, much easier.