From 01149274dc2ee8baf98d4c191a5d41252b455d50 Mon Sep 17 00:00:00 2001 From: Lucas Mior <49657055+lucas-mior@users.noreply.github.com> Date: Tue, 20 Apr 2021 17:25:38 -0300 Subject: [PATCH] improve %pistol-extra% substitution (#59) Followup to #58. --- previewer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/previewer.go b/previewer.go index 5c389a0..854f69e 100644 --- a/previewer.go +++ b/previewer.go @@ -5,7 +5,7 @@ import ( "os" "io" "os/exec" - "fmt" + // "fmt" "strconv" "strings" "regexp" @@ -176,7 +176,7 @@ func (p *Previewer) Write(w io.Writer) (error) { if (err == nil && len(p.Extras) > auxInt) { // substitute the %pistol-extra[#]% argument in the // final CLI string. - current := fmt.Sprintf("%%pistol-extra%d%%", auxInt) + current := arg[loc[0]:loc[1]] argAux = strings.ReplaceAll(argAux, current, p.Extras[auxInt]) } else { continue