Skip to content

Commit

Permalink
fwk/cmd/fwk-app: use gonuts/commander@v0.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
sbinet committed Dec 16, 2021
1 parent c571134 commit 505ab93
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions fwk/cmd/fwk-app/cmd_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
package main

import (
"flag"
"fmt"

"github.com/gonuts/commander"
"github.com/gonuts/flag"
"go-hep.org/x/hep/fwk/utils/builder"
)

Expand Down Expand Up @@ -56,7 +56,7 @@ func fwk_run_cmd_build(cmd *commander.Command, args []string) error {
return err
}

if o := cmd.Flag.Lookup("o").Value.Get().(string); o != "" {
if o := cmd.Lookup("o").(string); o != "" {
bldr.Name = o
}

Expand Down
8 changes: 4 additions & 4 deletions fwk/cmd/fwk-app/cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
package main

import (
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"

"github.com/gonuts/commander"
"github.com/gonuts/flag"
"go-hep.org/x/hep/fwk/utils/builder"
)

Expand Down Expand Up @@ -56,7 +56,7 @@ func fwk_run_cmd_run(cmd *commander.Command, args []string) error {
}
subargs = append(
subargs,
fmt.Sprintf("-"+nn+"=%v", val.Value.Get()),
fmt.Sprintf("-"+nn+"=%v", val.Value.(flag.Getter).Get()),
)
}

Expand All @@ -83,7 +83,7 @@ func fwk_run_cmd_run(cmd *commander.Command, args []string) error {
return err
}

if o := cmd.Flag.Lookup("o").Value.Get().(string); o != "" {
if o := cmd.Lookup("o").(string); o != "" {
bldr.Name = o
}

Expand All @@ -101,7 +101,7 @@ func fwk_run_cmd_run(cmd *commander.Command, args []string) error {
bin = filepath.Join(pwd, bin)
}

if !cmd.Flag.Lookup("k").Value.Get().(bool) {
if !cmd.Lookup("k").(bool) {
defer os.Remove(bin)
}

Expand Down
2 changes: 1 addition & 1 deletion fwk/cmd/fwk-app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
package main

import (
"flag"
"os"

"github.com/gonuts/commander"
"github.com/gonuts/flag"
)

func handle_err(err error) {
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ require (
github.com/campoy/embedmd v1.0.0
github.com/go-mmap/mmap v0.6.0
github.com/gonuts/binary v0.2.0
github.com/gonuts/commander v0.1.0
github.com/gonuts/flag v0.1.0
github.com/gonuts/commander v0.3.1
github.com/google/go-cmp v0.5.6
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/hashicorp/go-uuid v1.0.2
Expand Down
12 changes: 8 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gonuts/binary v0.2.0 h1:caITwMWAoQWlL0RNvv2lTU/AHqAJlVuu6nZmNgfbKW4=
github.com/gonuts/binary v0.2.0/go.mod h1:kM+CtBrCGDSKdv8WXTuCUsw+loiy8f/QEI8YCCC0M/E=
github.com/gonuts/commander v0.1.0 h1:EcDTiVw9oAVORFjQOEOuHQqcl6OXMyTgELocTq6zJ0I=
github.com/gonuts/commander v0.1.0/go.mod h1:qkb5mSlcWodYgo7vs8ulLnXhfinhZsZcm6+H/z1JjgY=
github.com/gonuts/flag v0.1.0 h1:fqMv/MZ+oNGu0i9gp0/IQ/ZaPIDoAZBOBaJoV7viCWM=
github.com/gonuts/flag v0.1.0/go.mod h1:ZTmTGtrSPejTo/SRNhCqwLTmiAgyBdCkLYhHrAoBdz4=
github.com/gonuts/commander v0.3.1 h1:fFT39Hnp68TKw4J+2U5yqWe2Dq92/zk7f7Bp+N8dDGk=
github.com/gonuts/commander v0.3.1/go.mod h1:BhmRpE3g17C5PXzOrFYblAsAsXCiAzxFMUDdPq1vnN8=
github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w=
github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
Expand All @@ -58,6 +56,10 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
Expand Down Expand Up @@ -92,6 +94,8 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo=
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
Expand Down

0 comments on commit 505ab93

Please sign in to comment.