aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-07-29 15:02:07 -0230
committerSam Anthony <sam@samanthony.xyz>2026-07-29 15:02:07 -0230
commit12aba53395c295880638f7f58f3a00271682bb58 (patch)
treed4fb13bf362a4f00538e46721d4465d3ab14b2dc /cmd
parent1ba515c30a004bd265052a10e6ca502daf63f92e (diff)
downloadlulu-12aba53395c295880638f7f58f3a00271682bb58.zip
shorten cost datastructure names
Diffstat (limited to 'cmd')
-rw-r--r--cmd/lulu/cost.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/lulu/cost.go b/cmd/lulu/cost.go
index 26f641e..1ef655d 100644
--- a/cmd/lulu/cost.go
+++ b/cmd/lulu/cost.go
@@ -15,14 +15,14 @@ import (
type CostCmd struct {
ShippingAddress
- Ship lulu.ShippingLevel `required help:"${ship_level_help}"`
- Items []PrintJobCostLineItem `required help:"${cost_item_help}"`
+ Ship lulu.ShippingLevel `required help:"${ship_level_help}"`
+ Items []CostLineItem `required help:"${cost_item_help}"`
}
func (cmd *CostCmd) Run(cli *kong.Kong, clnt *lulu.Client) error {
- items := make([]lulu.PrintJobCostLineItem, len(cmd.Items))
+ items := make([]lulu.CostLineItem, len(cmd.Items))
for i := range cmd.Items {
- items[i] = cmd.Items[i].PrintJobCostLineItem
+ items[i] = cmd.Items[i].CostLineItem
}
cost, addrVal, err := clnt.Cost(items, cmd.ShippingAddress.Addr(), cmd.Ship)
if err != nil {
@@ -42,11 +42,11 @@ func (cmd *CostCmd) Run(cli *kong.Kong, clnt *lulu.Client) error {
return w.Flush()
}
-type PrintJobCostLineItem struct {
- lulu.PrintJobCostLineItem
+type CostLineItem struct {
+ lulu.CostLineItem
}
-func (item *PrintJobCostLineItem) UnmarshalText(text []byte) error {
+func (item *CostLineItem) UnmarshalText(text []byte) error {
s := string(text)
groups := printJobCostLineItemExpr.FindStringSubmatch(s)
if len(groups) != 3+1 {
@@ -72,7 +72,7 @@ func (item *PrintJobCostLineItem) UnmarshalText(text []byte) error {
return nil
}
-func printCost(w io.Writer, cost lulu.PrintJobCost) {
+func printCost(w io.Writer, cost lulu.Cost) {
for _, fee := range cost.Fees {
fmt.Fprintf(w, "fee %s %s:\t%s %s\t\n", fee.Type, fee.Sku, fee.TotalCostExclTax, fee.Currency)
}