.bom

.bom addcategory "category"
.bom setcolumn "category" "section" "column" [...]
.bom data category" "section" "column=value" [...]
.bom 指令可新增資料至建置的「資料清單 (BOM)」。您可以用它來新增種類、區段以及資料。
種類
種類是列印在 BOM 中的標頭。請利用 addcategory 選項來指定它們。
.bom addcategory "category"
區段
區段定義了種類中的資料直欄。請利用 setcolumn 選項來指定區段及區段內的直欄。不會列印區段名稱。區段的直欄標頭集會列印在區段的開頭。您可以利用 -p 選項並識別母項區段來建立巢狀區段。

區段和直欄必須定義在試圖將資料加到其中的 data 選項之前。

.bom setcolumn "category" "section" "columnheader" [...]
.bom setcolumn "category" "section" -p parentsection"columnheader" [...]
資料
會將資料移入定義在區段中的直欄中。區段和直欄必須已利用 setcolumn 定義妥當。
.bom data category" "section" "column=value" [...]

下列範例顯示指定種類、區段和直欄以及資料時必須遵循的順序。


.bom addcategory "Spaceships"
.bom setcolumn "Spaceships" "Section1" "ShipName" "WarpSpeed" "Tonnage"
.bom setcolumn "Spaceships" "Subsection1" -p "Section1" "ShippingDate" "ShippingManifest"
.bom data "Spaceships" "Section1" "ShipName=SpaceShipOne" "WarpSpeed=9" "Tonnage=10000"
.bom data "Spaceships" "Subsection1" "ShippingDate=123" "ShippingManifest=456"
.bom data "Spaceships" "Section1" "ShipName=Freighter" "WarpSpeed=6" "Tonnage=20000" 

這個範例在 BOM 中顯示如下所示:

ShipName      WarpSpeed   Tonnage
SpaceShipOne      9        10000
                                   ShippingDate       ShippingManifest
                                       123                  456
Freighter         6        20000
至於其他點指令,您可以在指令中使用環境變數。像這個指令:
.bom data "Spaceships" "${SECTION}" "ShipName=${NAME}" "WarpSpeed=${SPEED}" "Tonnage=${TONNAGE}"

會以先前指令載入環境變數中的資料來植入 BOM。

您可以建立任何欄數,但是要在植入最後一個資料欄後,系統才會將資料行寫入 BOM。

如果您省略資料行中的某個直欄,系統就會使用上一列的值,如下列範例所示。
.bom addcategory "Spaceships"
.bom setcolumn "Spaceships" "Section1" "ShipName" "WarpSpeed" "Tonnage"
.bom data "Spaceships" "Section1" "ShipName=SpaceShipTwo" "WarpSpeed=3" "Tonnage=30000"
.bom data "Spaceships" "Section1" "ShipName=Tanker" "Tonnage=50000"

結果是 SpaceShipOne 中的 WarpSpeed 值會重複:
ShipName      WarpSpeed   Tonnage
SpaceShipTwo      3        30000
Tanker            3        50000

意見