Skip to content

Commit

Permalink
Rename files
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Heckel committed Apr 8, 2021
1 parent 640087c commit 04cb5f7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cmd/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func New() *cli.App {
return &cli.App{
Name: "elastictl",
Usage: "copy/paste across machines",
Usage: "Elasticsearch toolkit",
UsageText: "elastictl COMMAND [OPTION..] [ARG..]",
HideHelp: true,
HideVersion: true,
Expand All @@ -20,7 +20,7 @@ func New() *cli.App {
Writer: os.Stdout,
ErrWriter: os.Stderr,
Commands: []*cli.Command{
cmdDump,
cmdExport,
cmdBlast,
cmdReshard,
},
Expand Down
14 changes: 7 additions & 7 deletions cmd/dump.go → cmd/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ import (
"time"
)

var cmdDump = &cli.Command{
Name: "dump",
Aliases: []string{"d"},
Usage: "Dump an entire index to STDOUT",
UsageText: "elastictl dump SERVER INDEX",
Action: execDump,
var cmdExport = &cli.Command{
Name: "export",
Aliases: []string{"e"},
Usage: "Export an entire index to STDOUT",
UsageText: "elastictl export SERVER INDEX",
Action: execExport,
Flags: []cli.Flag{
&cli.StringFlag{Name: "search", Aliases: []string{"q"}, Value: "", Usage: "only dump documents matching the given ES query"},
},
}

var settingsToRemove = []string{"settings.index.creation_date", "settings.index.uuid", "settings.index.version", "settings.index.provided_name"}

func execDump(c *cli.Context) error {
func execExport(c *cli.Context) error {
rand.Seed(time.Now().UnixNano())

search := c.String("search")
Expand Down
12 changes: 6 additions & 6 deletions cmd/blast.go → cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
)

var cmdBlast = &cli.Command{
Name: "blast",
Aliases: []string{"b"},
Usage: "Write to ES index, either from STDIN",
UsageText: "elastictl blast SERVER INDEX",
Action: execBlast,
Name: "import",
Aliases: []string{"i"},
Usage: "Write to ES index from STDIN",
UsageText: "elastictl import SERVER INDEX",
Action: execImport,
Flags: []cli.Flag{
&cli.IntFlag{Name: "workers", Aliases: []string{"w"}, Value: 100, Usage: "number of concurrent workers"},
&cli.IntFlag{Name: "shards", Aliases: []string{"s"}, Value: 0, Usage: "override the number of shards on index creation"},
Expand All @@ -31,7 +31,7 @@ var cmdBlast = &cli.Command{
},
}

func execBlast(c *cli.Context) error {
func execImport(c *cli.Context) error {
rand.Seed(time.Now().UnixNano())

workers := c.Int("workers")
Expand Down
2 changes: 1 addition & 1 deletion cmd/reshard.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

var cmdReshard = &cli.Command{
Name: "reshard",
Aliases: []string{"c"},
Aliases: []string{"r"},
Action: execReshard,
}

Expand Down

0 comments on commit 04cb5f7

Please sign in to comment.