mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
migrate cli to internal package (#301)
This commit is contained in:
parent
336b89eeba
commit
f3d6620ecc
39 changed files with 51 additions and 44 deletions
11
cmd/cli/main.go
Normal file
11
cmd/cli/main.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/ethereum/go-ethereum/internal/cli"
|
||||
)
|
||||
|
||||
func main() {
|
||||
os.Exit(cli.Run(os.Args[1:]))
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import "github.com/mitchellh/cli"
|
||||
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
)
|
||||
|
||||
type AccountImportCommand struct {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
)
|
||||
|
||||
type AccountListCommand struct {
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
)
|
||||
|
||||
type AccountNewCommand struct {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/cli"
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
)
|
||||
|
||||
// ChainSetHeadCommand is the command to group the peers commands
|
||||
|
|
@ -1,23 +1,19 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/command/server"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
"github.com/mitchellh/cli"
|
||||
"github.com/ryanuber/columnize"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
os.Exit(Run(os.Args[1:]))
|
||||
}
|
||||
|
||||
func Run(args []string) int {
|
||||
commands := commands()
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
// Based on https://github.com/hashicorp/nomad/blob/main/command/operator_debug.go
|
||||
|
||||
|
|
@ -16,8 +16,8 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
gproto "github.com/golang/protobuf/proto"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/cli"
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
)
|
||||
|
||||
// PeersAddCommand is the command to group the peers commands
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
)
|
||||
|
||||
// PeersListCommand is the command to group the peers commands
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
)
|
||||
|
||||
// PeersRemoveCommand is the command to group the peers commands
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
)
|
||||
|
||||
// PeersStatusCommand is the command to group the peers commands
|
||||
|
|
@ -14,12 +14,12 @@ import (
|
|||
|
||||
godebug "runtime/debug"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/server/chains"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/fdlimit"
|
||||
"github.com/ethereum/go-ethereum/eth/downloader"
|
||||
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
||||
"github.com/ethereum/go-ethereum/eth/gasprice"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/chains"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/command/flagset"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||
)
|
||||
|
||||
func (c *Command) Flags() *flagset.Flagset {
|
||||
|
|
@ -11,11 +11,11 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/eth"
|
||||
"github.com/ethereum/go-ethereum/eth/tracers"
|
||||
"github.com/ethereum/go-ethereum/ethstats"
|
||||
"github.com/ethereum/go-ethereum/graphql"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
"github.com/ethereum/go-ethereum/metrics/influxdb"
|
||||
|
|
@ -7,9 +7,9 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/server/pprof"
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/pprof"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||
gproto "github.com/golang/protobuf/proto"
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/command/server/proto"
|
||||
"github.com/ethereum/go-ethereum/internal/cli/server/proto"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
)
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
Loading…
Reference in a new issue