From 411323dcca31a91c1da966b88244a281fe6f2902 Mon Sep 17 00:00:00 2001 From: Goutte Date: Sun, 2 Feb 2025 12:24:40 +0100 Subject: [PATCH] fix: make the test suite happy again I've had to disable the usage template i18n. --- command.go | 15 +++++++++------ locales/default.pot | 6 +++++- locales/default/en.mo | Bin 3185 -> 3231 bytes locales/default/en.po | 4 ++-- locales/default/fr.mo | Bin 3415 -> 3469 bytes locales/default/fr.po | 4 ++-- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/command.go b/command.go index 50173b92..a1512d14 100644 --- a/command.go +++ b/command.go @@ -446,11 +446,14 @@ func (c *Command) UsageFunc() (f func(*Command) error) { return func(c *Command) error { c.mergePersistentFlags() fn := c.getUsageTemplateFunc() - data := CommandUsageTemplateData{ - Command: c, - I18n: getCommandGlossary(), - } - err := fn(c.OutOrStderr(), data) + // FIXME: this breaks the template func signature ; we need another approach ? + //data := CommandUsageTemplateData{ + // Command: c, + // I18n: getCommandGlossary(), + //} + //err := fn(c.OutOrStderr(), data) + ////////////////////////////////////////////////////////////////////////////// + err := fn(c.OutOrStderr(), c) if err != nil { c.PrintErrln(err) } @@ -1270,7 +1273,7 @@ func (c *Command) InitDefaultHelpCmd() { c.helpCommand = &Command{ Use: fmt.Sprintf("help [%s]", gotext.Get("command")), Short: gotext.Get("CommandHelpShort"), - Long: fmt.Sprintf(gotext.Get("CommandHelpLong"), c.DisplayName()+fmt.Sprintf(" help [%s]", gotext.Get("command"))), + Long: fmt.Sprintf(gotext.Get("CommandHelpLong"), c.DisplayName()+fmt.Sprintf(" help [%s]", gotext.Get("PathToCommand"))), ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]string, ShellCompDirective) { var completions []string cmd, _, e := c.Root().Find(args) diff --git a/locales/default.pot b/locales/default.pot index 6644be0b..67e39981 100644 --- a/locales/default.pot +++ b/locales/default.pot @@ -160,4 +160,8 @@ msgstr "" #: command.go:1247 #: command.go:1249 msgid "command" -msgstr "" \ No newline at end of file +msgstr "" + + +msgid "PathToCommand" +msgstr "" diff --git a/locales/default/en.mo b/locales/default/en.mo index b7ab9e04ed1205546edb24722622907e60988406..4c1622954e94132977bcb4b207cca165ceb863b8 100644 GIT binary patch delta 790 zcmXZa%}Z2K9LDkA-0RIuCv^sMrcr0qj7l&PL_sv)5(xq$=?z*;3Poh2IICQYu0$jd zu3`kzKp+Gylxb7C(m%kR3PBPsTiL?EmEXsi!<_k?bLQT2pYxl09Qhp0{0+?qezQEOHq8hT3=?6>t+za0eCSCyP&TAFtr;i+KmJk@*Xp!CAb^ z^UWzSi(?<&!k4H3ACT~t#SUD zi`SqA#={-a7Cq6|uY9d*JkRG@pP2R%gvOCle8RhXv>^Y^Gq%^_Rb0&1TX+igd1m^hES_!{%rzyaQG znJ%*|K0_t2g(Piz_!KKxz#6IpF|x>D0olXeqAD!oB7VeI*g$n)mMWBB5w-pX^{KvN zS*>m`QN}l@$|AHwiS(mhkVPdlh5T$Lh@S`XOH_xJku7Wuwa*4}oLbLlzyG733AyP! z`R|-APv>XIKXg)e)h7+5oAGN-EIq(X#p#G>@b!&8v_{fzI-{OSjQc}w%o}9(usY+G a9KY_xtG~Q@$ekFUtbXnM>H43;fByl|ZAB9R diff --git a/locales/default/en.po b/locales/default/en.po index a676bb5c..abcd679d 100644 --- a/locales/default/en.po +++ b/locales/default/en.po @@ -168,5 +168,5 @@ msgstr "version for" msgid "command" msgstr "command" -#~ msgid "PathToCommand" -#~ msgstr "path to command" +msgid "PathToCommand" +msgstr "path to command" diff --git a/locales/default/fr.mo b/locales/default/fr.mo index da9097e8f646c14dcd2f8fe2c315ceac6cbf75a2..16fa459d0a4904e4ffef129c158e0454323a98dd 100644 GIT binary patch delta 799 zcmXZaJxE(o6u|M5mt138V`GA7d}?CaKtsTSMHGr9MG+AMK~Z$5hBTlhANbLBkdg{r zO6l}ao6S{lP@;qAAT2nyxF`q;rK6kR;?(~!x$yEk_vOBO&pF)lmhX1)D&ScYMvSMG zXTT-WjaiEyM$#?PjIZ%APNN^+p{`%SDE`0}JVYDMs_$>`8S_SuNIkwngCp1@Qj{@* zHeP%~O=1g!_y@iC4?}p3eQ5Yv?Z-x3MNMP_eYl5gEI;uf-l2YPYAT6^Q4@KI&73d8 z1X@`d>u?DJ__;cF@DcM(q!`&o-FOEz!9%>oU-$$Mc=;YLF^*%kl@5Nw=gil!geN%8 z`7-;UlG#4KV1A0)a>FU?DeX9jF&x4yPUAl6hJLc+6G>t_4&wyQqpmwf?T}4%`hPDr z;UpH{5EKX!_#3tIJJeSC_@R4Zqqe#ONm_bPD^H@{g(1{+Q>d+-L0y+ewvvz4`4{AR z-M`aw7+N3IIty0NX!D}ZSIhQ2CDIJ_Uc{VTE7%qx(i${>9bAU{nl-kazgEKNYnNTCXt%YJP#h46a>8K~$8g~_;5`sZlBb1d$Pnqn1(O#g z>k$cI57y%pHee35{|Y8>8^d^o5xjTX->{Rq1*{$cX zhWaM52-!m&cpo*f6D;8cw&O94dAz|c?5q5nXbHQiuVWD}aTZ6bNR0XAkf0YG)XYAR zG0U?}fR9-xaRzgEh&tdm(p3^<8N)Qr<1}i&Gt`~=aleOI&ftBGd<3=@6_w8*2auq+y+HB diff --git a/locales/default/fr.po b/locales/default/fr.po index 9bb83c22..c1010fef 100644 --- a/locales/default/fr.po +++ b/locales/default/fr.po @@ -168,5 +168,5 @@ msgstr "version pour" msgid "command" msgstr "commande" -#~ msgid "PathToCommand" -#~ msgstr "command" +msgid "PathToCommand" +msgstr "chemin vers la commande"