File tree 5 files changed +33
-7
lines changed
5 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ func New(version string, fs embed.FS) *cmdr.App {
29
29
abroot = cmdr .NewApp ("abroot" , version , fs )
30
30
return abroot
31
31
}
32
+
32
33
func NewRootCommand (version string ) * cmdr.Command {
33
34
root := cmdr .NewCommand (
34
35
abroot .Trans ("abroot.use" ),
@@ -38,7 +39,7 @@ func NewRootCommand(version string) *cmdr.Command {
38
39
WithPersistentBoolFlag (
39
40
cmdr .NewBoolFlag (
40
41
verboseFlag ,
41
- "v " ,
42
+ "V " ,
42
43
abroot .Trans ("abroot.verboseFlag" ),
43
44
false ))
44
45
root .Version = version
Original file line number Diff line number Diff line change 1
1
module github.com/vanilla-os/abroot
2
2
3
- go 1.21.4
3
+ go 1.22
4
4
5
5
require (
6
6
github.com/containers/buildah v1.35.1
@@ -15,7 +15,7 @@ require (
15
15
github.com/spf13/cobra v1.8.0
16
16
github.com/spf13/viper v1.18.2
17
17
github.com/vanilla-os/differ/diff v0.0.0-20240202135932-673de99cc540
18
- github.com/vanilla-os/orchid v0.5 .0
18
+ github.com/vanilla-os/orchid v0.6 .0
19
19
github.com/vanilla-os/prometheus v1.0.0
20
20
github.com/vanilla-os/sdk v0.0.0-20240424182549-7fbf2ce02046
21
21
golang.org/x/sys v0.18.0
Original file line number Diff line number Diff line change @@ -459,6 +459,8 @@ github.com/vanilla-os/differ/diff v0.0.0-20240202135932-673de99cc540 h1:KrNjRudM
459
459
github.com/vanilla-os/differ/diff v0.0.0-20240202135932-673de99cc540 /go.mod h1:HMg24arXCutcwngVaJ4DQuhwLmS8CA/CuVSjEyIxFpw =
460
460
github.com/vanilla-os/orchid v0.5.0 h1:QAOjJ2VcyND5TxK0XYUEu+dysxXicRHhV6i/07S47mk =
461
461
github.com/vanilla-os/orchid v0.5.0 /go.mod h1:dNPvHxofO4hEXodEKXp0nLQDZhoHh8evCUXc6X1xLao =
462
+ github.com/vanilla-os/orchid v0.6.0 h1:aH7i621QrqtbspGUie4To28zCk1u1UvGHGzL11wdldE =
463
+ github.com/vanilla-os/orchid v0.6.0 /go.mod h1:dNPvHxofO4hEXodEKXp0nLQDZhoHh8evCUXc6X1xLao =
462
464
github.com/vanilla-os/prometheus v1.0.0 h1:je+vWK9Ir1SzCIz2yoSE3tFmGKli4Q1z/LQ5mNk/+Pc =
463
465
github.com/vanilla-os/prometheus v1.0.0 /go.mod h1:CPWeG0LJW4gHcLHSkqx9jANi5574a03R3ihWNy4PIig =
464
466
github.com/vanilla-os/sdk v0.0.0-20240424182549-7fbf2ce02046 h1:FYVQ7Suwq2O7D7Nm1XiWcy78M5z2PHd/HZJYFBiJ9HM =
Original file line number Diff line number Diff line change 5
5
short : " ABRoot provides full immutability and atomicity by performing transactions
6
6
between 2 root partitions (A<->B)"
7
7
verboseFlag : " show more detailed output"
8
+ msg :
9
+ help : " Show help for abroot."
10
+ version : " Show version for abroot."
11
+ usage : " Usage"
12
+ aliases : " Aliases"
13
+ examples : " Examples"
14
+ availableCommands : " Available Commands"
15
+ additionalCommands : " Additional Commands"
16
+ flags : " Flags"
17
+ globalFlags : " Global Flags"
18
+ additionalHelpTopics : " Additional help topics"
19
+ moreInfo : " Use %s for more information about a command"
8
20
9
21
kargs :
10
22
use : " kargs"
Original file line number Diff line number Diff line change @@ -22,9 +22,7 @@ import (
22
22
"github.com/vanilla-os/orchid/cmdr"
23
23
)
24
24
25
- var (
26
- Version = "2.0.1"
27
- )
25
+ var Version = "2.0.1"
28
26
29
27
//go:embed locales/*.yml
30
28
var fs embed.FS
@@ -39,7 +37,20 @@ func main() {
39
37
40
38
// root command
41
39
root := cmd .NewRootCommand (Version )
42
- abroot .CreateRootCommand (root )
40
+ abroot .CreateRootCommand (root , abroot .Trans ("abroot.msg.help" ), abroot .Trans ("abroot.msg.version" ))
41
+
42
+ msgs := cmdr.UsageStrings {
43
+ Usage : abroot .Trans ("abroot.msg.usage" ),
44
+ Aliases : abroot .Trans ("abroot.msg.aliases" ),
45
+ Examples : abroot .Trans ("abroot.msg.examples" ),
46
+ AvailableCommands : abroot .Trans ("abroot.msg.availableCommands" ),
47
+ AdditionalCommands : abroot .Trans ("abroot.msg.additionalCommands" ),
48
+ Flags : abroot .Trans ("abroot.msg.flags" ),
49
+ GlobalFlags : abroot .Trans ("abroot.msg.globalFlags" ),
50
+ AdditionalHelpTopics : abroot .Trans ("abroot.msg.additionalHelpTopics" ),
51
+ MoreInfo : abroot .Trans ("abroot.msg.moreInfo" ),
52
+ }
53
+ abroot .SetUsageStrings (msgs )
43
54
44
55
upgrade := cmd .NewUpgradeCommand ()
45
56
root .AddCommand (upgrade )
You can’t perform that action at this time.
0 commit comments