Add option to specify number of cards/kits for digikey BOM submission
[eda-utils.git] / bomgen / bomgen.php
index 927abf0..81c21d6 100755 (executable)
@@ -21,6 +21,7 @@ require_once 'Bomgen/digikey.inc.php';
 $debug = 0;
 
 $digikey_bom = false;
+$kits = 1;
 
 define("DATA_ROW_START", 3);
 
@@ -60,6 +61,8 @@ $csv_infos =
                                   "width" => 0),
         );
 
+$short_opts = "hckn:";
+
 function usage()
 {
   echo "Usage: bomgen.php [OPTIONS] [INPUT FILE]\n";
@@ -70,6 +73,7 @@ function usage()
   echo "  -c  Add cost information to the BOM\n";
   echo "  -k  Create digikey BOM submission file (tab-separated fields)\n";
   echo "  -h  Display this help and exit\n";
+  echo "  -n  Number of cards/kits for digikey BOM submission\n";
 }
 
 /*
@@ -166,8 +170,6 @@ $add_cost = false;
 $comp_total = 0;
 $titre = "BOM";
 
-$short_opts = "hck";
-
 $cg = new Console_Getopt();
 
 /* Read the command line. */
@@ -193,6 +195,9 @@ if (sizeof($opts) > 0) {
         case 'k':
           $digikey_bom = true;
           break;
+        case 'n':
+          $kits = $o[1];
+          break;
         case 'h':
           usage();
           exit(1);