Compare commits

...

2 Commits

Author SHA1 Message Date
221db4e998
return a numbered list of vouchers 2024-09-25 16:06:06 +03:00
0e376e0d9e
include back and quit 2024-09-25 16:03:08 +03:00
2 changed files with 11 additions and 4 deletions

View File

@ -281,7 +281,12 @@ func (h *Handlers) GetVoucherList(ctx context.Context,sym string,input []byte) (
"VSGAQ", "VSGAQ",
"QPWIQQ", "QPWIQQ",
} }
res.Content = strings.Join(vouchers,"\n")
var numberedVouchers []string
for i, voucher := range vouchers {
numberedVouchers = append(numberedVouchers, fmt.Sprintf("%d:%s", i+1, voucher))
}
res.Content = strings.Join(numberedVouchers,"\n")
return res,nil return res,nil
} }

View File

@ -1,9 +1,11 @@
LOAD get_vouchers 0 LOAD get_vouchers 0
MAP get_vouchers MAP get_vouchers
MOUT back 0
MOUT quit 9
MNEXT next 11 MNEXT next 11
MPREV back 22 MPREV prev 22
HALT HALT
INCMP _ 0
INCMP quit 9
INCMP > 11 INCMP > 11
INCMP < 22 INCMP < 22
INCMP _*