This manual is for Marchande (version 2), an example about how to make a command-line interface.

Copyright © 2019 Vivien Kraus

     Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 or any later version published by the Free Software Foundation.

Play the merchant
*****************

This manual is for marchande version 2.

Introduction
************

You find yourself facing the organic vegetable seller.  In front of her, on her stall, you see a crate containing potatoes and bunches of radishes.  The seller thanks the previous customer and turns to you.

       * Next!  What will it be?

You need to buy a few radishes and potatoes.  You're going to have to be able to buy it from the merchant...

Invoking marchande
******************

When you run the marchande program, you have a command-line interface.  There are several options:

  * say that will be all, and the program exits;

  * say a bunch of radishes, or 2 bunches of radishes, or another number, to add some radishes;

  * say 1.3kg of potatoes, to add some potatoes.

Invoking marchande_complete
***************************

The marchande_complete program is used in the following way:

     marchande_complete "TEXT BEFORE" "TEXT AFTER"

The program prints either nothing, or the list of possibilities for the first word between the text before and the text after.  In case of a number, nothing is proposed.  In case of an error, the program exits with code 1.