Ordering pizza from the command line tutorial

This is a tutorial on how to order pizza from the command line. You don’t even have to get on the phone or open up a browser window. This arrangement is ideal for those who are in the middle of an extensive coding session and don’t want to interrupt their Linux-mode train of thought just to obtain necessary sustenance.

First you’ll need to obtain the pizza script; the latest version is available for download here. Just unzip it and you’re almost ready to order your pizza! (Note that the script only supports Dominoes at this time.)

But before you get it running successfully, you may need to install the Perl module Getopt::Mixed. Run CPAN and, at the prompt, install it:

$ sudo perl -MCPAN -e shell
[...skip loading and configuration text, there are other tutorials out there for that...]
cpan[1]> install Getopt::Mixed

[… it is installed …]

Now we’re ready for some hardcore command-line pizza-ordering. Try running ./pizza_party –help for a listing of the command-line arguments.

$ ./pizza_party --help
Usage: pizza_party [OPTIONS] [QUANTITY=1] [SIZE=large] [CRUST=regular]

1 <= QUANTITY <= 5. Default is 1. SIZE can be: (small|s) or (medium|med|m) or (large|l). Default is large. CRUST can be: (thin|t) or (regular|reg|r) or (deep|d). Default is regular. Example: `pizza_party -pmx 2 medium regular` orders 2 medium regular crust pizzas with pepperoni, mushrooms, and extra-cheese, right to your door! [-U | --username] user name [-P | --password] password [-I | --input-file] input file to read batch of pizza (see man page) [-V | --verbose] verbose [-Q | --quiet] quiet [-F | --force] don't ask for confirmation before ordering [-H | --help] show the command options/arguments for pizza_party [-o | --onions] with onions [-g | --green-peppers] with green peppers [-m | --mushrooms] with mushrooms [-v | --olives] with olives [-t | --tomatoes] with tomatoes [-h | --pineapple] with pineapple [-x | --extra-cheese] extra-cheese [-d | --cheddar-cheese] with cheddar cheese [-p | --pepperoni] with pepperoni [-s | --sausage] with sausage [-w | --ham] with ham (sWine, Wilbur) [-b | --bacon] with bacon [-e | --ground-beef] with ground beef [-c | --grilled-chicken] with grilled chicken [-z | --anchovies] with anchovieZZZZ [-u | --extra-sauce] with extra sauce

There you go; that's pretty much all you need to order pizza. Here's a typical order that I might make with my friends:

$ pizza_party -pe 2 large regular

Now unfortunately the pizza script doesn't yet support ordering pizzas with half-and-half toppings, nor does it yet support ordering multiple different kinds of pizza from the command line (although you can do this using a batch file). Hopefully the next version will have these options. And a choice of vendors would be a good feature too, as some people prefer, say, Pizza Hut.

Comments are closed.