To learn more about CUPS, you can access the CUPS documentation on your Mac by opening Safari and browsing to http://localhost:631/documentation.html. You may want to explore the following manpages for more information about how to use the printing system from the command line:
lp
lpstat
lpoptions
pstopdf
enscript
atprint
at_cho_prn