Skip to content

Commit

Permalink
fix version flag for booster-http and booster-bitswap (#1590)
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense authored Jul 24, 2023
1 parent 7600c71 commit b178d6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
11 changes: 0 additions & 11 deletions cmd/booster-bitswap/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"path/filepath"

"github.com/filecoin-project/boost/build"
"github.com/libp2p/go-libp2p"
crypto "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/host"
Expand Down Expand Up @@ -115,13 +114,3 @@ var initCmd = &cli.Command{
return err
},
}

var versionCmd = &cli.Command{
Name: "version",
Usage: "Print booster-bitswap version",
Before: before,
Action: func(cctx *cli.Context) error {
fmt.Println("booster-bitswap " + build.UserVersion())
return nil
},
}
8 changes: 3 additions & 5 deletions cmd/booster-bitswap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"os"

"github.com/filecoin-project/boost/build"
"github.com/filecoin-project/boostd-data/shared/cliutil"
logging "github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
Expand All @@ -22,16 +23,15 @@ func main() {
Name: "booster-bitswap",
Usage: "Bitswap endpoint for retrieval from Filecoin",
EnableBashCompletion: true,
Version: build.UserVersion(),
Flags: []cli.Flag{
cliutil.FlagVerbose,
cliutil.FlagVeryVerbose,
FlagRepo,
},
Commands: []*cli.Command{
initCmd,
runCmd,
fetchCmd,
versionCmd,
},
}
app.Setup()
Expand All @@ -43,10 +43,8 @@ func main() {

func before(cctx *cli.Context) error {
_ = logging.SetLogLevel("booster", "INFO")
_ = logging.SetLogLevel("remote-blockstore", "INFO")

if cliutil.IsVerbose {
_ = logging.SetLogLevel("remote-blockstore", "INFO")
}
if cliutil.IsVeryVerbose {
_ = logging.SetLogLevel("booster", "DEBUG")
_ = logging.SetLogLevel("remote-blockstore", "DEBUG")
Expand Down
7 changes: 3 additions & 4 deletions cmd/booster-http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"os"

"github.com/filecoin-project/boost/build"
"github.com/filecoin-project/boostd-data/shared/cliutil"
logging "github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
Expand All @@ -22,8 +23,8 @@ func main() {
Name: "booster-http",
Usage: "HTTP endpoint for retrieval from Filecoin",
EnableBashCompletion: true,
Version: build.UserVersion(),
Flags: []cli.Flag{
cliutil.FlagVerbose,
cliutil.FlagVeryVerbose,
FlagRepo,
},
Expand All @@ -40,10 +41,8 @@ func main() {

func before(cctx *cli.Context) error {
_ = logging.SetLogLevel("booster", "INFO")
_ = logging.SetLogLevel("remote-blockstore", "INFO")

if cliutil.IsVerbose {
_ = logging.SetLogLevel("remote-blockstore", "INFO")
}
if cliutil.IsVeryVerbose {
_ = logging.SetLogLevel("booster", "DEBUG")
_ = logging.SetLogLevel("remote-blockstore", "DEBUG")
Expand Down

0 comments on commit b178d6f

Please sign in to comment.