From fdef2ed7d85bb3bf363cb4d6e5798e125bca10d2 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Wed, 22 Jan 2014 13:30:29 -0500 Subject: [PATCH] Add option to specify BOM revision --- bomgen/bomgen.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/bomgen/bomgen.php b/bomgen/bomgen.php index 1108cf1..42d6ace 100755 --- a/bomgen/bomgen.php +++ b/bomgen/bomgen.php @@ -48,8 +48,6 @@ $col_num_to_id = array(); $entete = array(); -$short_opts = "hci:kn:t:"; - function usage() { echo "Usage: bomgen.php [OPTIONS] [INPUT FILE]\n"; @@ -58,14 +56,16 @@ function usage() echo "\n"; echo "Options:\n"; echo " -c Add cost information to the BOM\n"; - echo " -i Specifiy inventory CSV file\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"; - echo " -t BOM input type:\n"; - echo " pcad or altium\n"; + echo " -i [FILE] Specifiy inventory CSV file\n"; + echo " -k Create digikey BOM submission file (tab-separated fields)\n"; + echo " -h Display this help and exit\n"; + echo " -n [QTY] Number of cards/kits for digikey BOM submission\n"; + echo " -r [REV] Specify BOM revision\n"; + echo " -t [TYPE] BOM input type: pcad or altium\n"; } +$short_opts = "hci:kn:r:t:"; + $cg = new Console_Getopt(); /* Read the command line. */ @@ -97,6 +97,9 @@ if (sizeof($opts) > 0) { case 'n': $kits = $o[1]; break; + case 'r': + $revision = $o[1]; + break; case 'h': usage(); exit(1); @@ -322,7 +325,7 @@ if ($digikey_bom) { xls_write_cell_gen(0, 0, "BOM " . $project_name, XLS_FORMAT_TEXT, false, 18, FALSE, FALSE); - xls_write_cell_gen(1, 0, "Révision (schéma): " . $revision, + xls_write_cell_gen(1, 0, "Révision: " . $revision, XLS_FORMAT_TEXT, false, 16, FALSE, FALSE); xls_write_cell_gen(1, 2, "Composants: " . $comp_total, -- 2.20.1