DragonFly On-Line Manual Pages
PANTRY(1) Reference pages PANTRY(1)
NAME
pantry - nutrient tracking and analysis
SYNOPSIS
pantry [options...] [collection...]
DESCRIPTION
pantry copies foods from collections into a buffer. All foods are
copied, unless one or more --search options are specified, in which
case only foods that match the patterns of every --search option are
copied. pantry then changes every food in the buffer using any
--change options specified as well as any options for changing
nutrients, available units, and ingredients.
If --edit or --delete is specified, pantry deletes the unchanged foods
from the corresponding original collections. If --edit is specified,
pantry adds changed foods to corresponding original collections.
If --print REPORT is specified, buffer is printed using REPORT Buffer
is unsorted unless one or more --key TRAIT is specified. Sorting may be
affected by one or more --list options.
If --add COLLECTION is specified, each food in the buffer is added to
COLLECTION.
pantry communicates with a pantryd server, see pantryd(1).
OPTIONS
TRAIT is any one of:
o name
o group
o quantity
o unit
o date
o meal
o comment
o order
o refuse
o percent-refuse
o yield
o instructions
TRAIT names may be abbreviated.
PATTERN is an extended regular expression, unless --ignore-case is on.
Most options other than file and server control options may appear on
the command line more than once; the effect of multiple options is
cumulative.
File and server control
--open filename
Close currently open database and open filename
--read filename
Append contents of filename to currently open database
--close
Close currently open database
--save
Save currently open database
--save-as filename
Save currently open database under a different filename
--quit
Shut down server
--status
Display server status and database information: names of
collections in database and the number of foods in each collection,
and what filename will be used if --save option is used
Food selection
--search TRAIT PATTERN, -s TRAIT PATTERN
Include in buffer only foods whose TRAIT matches PATTERN.
Changing food traits
--change TRAIT string, -c TRAIT string
Change TRAIT string. If TRAIT is unit, string is a pattern that
must match exactly one of the food's available units. If TRAIT is
quantity or unit, string must be convertible to a non-negative
number. If TRAIT is percent-refuse, string must be convertible to a
number between 0 and 100, inclusive.
--refuse, -r
Reduce food quantity by percent refuse.
Changing nutrients, available units, and
ingredients
--change-nut string number
Change nutrient whose name is string to number.
--rename-nut pattern string
Rename nutrient whose name matches pattern to string.
--delete-nuts PATTERN
Delete all nutrients matching PATTERN.
--change-avail-unit string number
Change available unit whose name is string to number.
--rename-avail-unit pattern string
Rename available unit whose name matches pattern to string.
--delete-avail-units PATTERN
Delete all available units matching PATTERN.
--add-ingredients COLLECTION
Add ingredients from COLLECTION.
--delete-ingredients PATTERN
Delete ingredients whose name trait matches PATTERN.
Search and edit options
--ignore-case, -i
All patterns are case insensitive.
--exact-match, -x
All patterns must exactly match their subjects (turns off regular
expressions).
--edit
Edit foods in place
--delete
Delete matching foods
--create
Create a new food from scratch. When this option is used, Pantry
does not copy foods from any collections specified on the command
line, and the --edit and --delete options are ignored.
--limit number
Limit number of foods in buffer to number
Reporting
--print report, -p report
Print report (see "Reports" section below)
--key TRAIT, -k TRAIT
Use TRAIT as a sorting key. If the first letter of TRAIT is
lowercase, sort in ascending order; if the first letter of TRAIT is
uppercase, sort in descending order.
--goal nutrient-name amount, -g nutrient-name amount
Add a nutrient intake goal for use by the nutrient-related reports,
where nutrient-name is the nutrient for which you wish to add a
goal, and amount is a string, convertible to a non-negative number,
that is the amount of the goal.
--list TRAIT string, -l TRAIT string
Add string to the list of strings that will be used when TRAIT is
used as a sorting key. When TRAIT is equal to one of these values,
it will be sorted in the order specified.
Adding results to collections
--add COLLECTION, -a COLLECTION
Add buffer to COLLECTION.
--auto-order, -o
When adding each food to collections specified with --add, pantry
will search the collection for other foods with identical date and
meal traits. The result will be sorted in ascending order by the
order trait. If the highest food's order trait matches the regular
expression ^[0-9]4$, then pantry will take the highest food's order
trait, remove any leading zeroes, remove the last digit, and
increment the result by one. The result is multiplied by ten, and
then is left-padded with zeroes so that it is four characters long.
pantry will then change the order trait of the food to the result
before adding it to the collection.
If there are no foods with identical date and meal traits, then
pantry will set the food's order trait to 0010.
Meta
--help, -h
Display brief help.
--version, -v
Display Pantry version.
--copyright
Display copyright information.
REPORTS
Two types of reports are available. Food reports are printed once per
food in the buffer. Summary reports are printed once for the entire
buffer. To print more than one report, use multiple --print options.
Report names may be abbreviated with an unambiguous specification of
the first letters of the report. The following reports are available:
Food reports
name
Food names
info
All traits other than the name, yield, and instructions.
recipe
yield and instructions traits, and the recipe's ingredients.
Ingredients are sorted according to their order traits.
units
Available units. g, oz, and lb are not printed as these are
available for every food.
paste
Each food name, printed with one available unit per line; quoted so
that output may be easily pasted into subsequent pantry commands.
blank
A blank line
nuts
All of a food's nutrients
goals
Nutrients for which there is a goal specified with --goal
Summary reports
groups
Number of foods in each food group, as specified by each food's
group trait
Nuts
Sum of all nutrients in the buffer
Goals
Sum of all nutrients in the buffer for which there is a --goal
ENVIRONMENT VARIABLES
PANTRY_SOCKET
If this environment variable is specified, pantry will use the path
contained therein as the filename of the socket where it will
attempt to connect to the pantryd server. PANTRY_SOCKET should
contain the entire path (beginning with / ) and filename, not just
the directory for the socket. The server must have already been
started with an identical value in its PANTRY_SOCKET environment
variable.
If this environment variable is not specified, pantry will attempt
to connect to a server at the socket named $HOME/.pantrySocket.
BUGS
Please help find them. Report bugs to <omari@smileystation.com>.
Pantry has known limitations; see the Pantry User Guide for details.
PANTRY HOME PAGE
http://www.smileystation.com/pantry
AUTHOR
Omari Norman
Author.
COPYRIGHT
Copyright (C) 2007-2008 Omari Norman
Pantry 32 Saturday, March 14, 2009 PANTRY(1)