Skip to content

Commit

Permalink
Merge pull request #39 from airdb/dev
Browse files Browse the repository at this point in the history
support mysql command
  • Loading branch information
deancn authored Apr 9, 2021
2 parents 89fd2d9 + bf932cc commit 128a02f
Show file tree
Hide file tree
Showing 17 changed files with 347 additions and 209 deletions.
94 changes: 0 additions & 94 deletions .github/workflows/release.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ linters-settings:
linters:
disable:
- gochecknoglobals
- exhaustive
- forbidigo
- exhaustivestruct
- paralleltest
- wrapcheck
enable-all: true

skip-dirs:
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ LDFLAGS += "-X=airdb.io/airdb/adb/internal/adblib.Version=$(VERSION) \
-X=airdb.io/airdb/adb/internal/adblib.Build=$(BUILD) \
-X=airdb.io/airdb/adb/internal/adblib.BuildTime=$(shell date +%s)"

myos = $(word 1, $@)
ifndef $myos
myos = "$(shell uname | tr A-Z a-z)"
endif
SYSTEM:=
#myos = $(word 1, $@)
#ifndef $myos
# myos = "$(shell uname | tr A-Z a-z)"
#endif

.PHONY: test

Expand All @@ -20,7 +21,7 @@ test:
go test -v ./...

build:
CGO_ENABLED=0 GOOS=$(myos) GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY)
CGO_ENABLED=0 $(SYSTEM) GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY)

PLATFORMS := windows linux darwin
os = $(word 1, $@)
Expand Down
5 changes: 3 additions & 2 deletions internal/adblib/example.go → cmd/example.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package adblib
package cmd

import (
"github.com/MakeNowJust/heredoc"
)

var SQLDoc = heredoc.Doc(`
adb mysql mina-api -uroot -ppasswd --db test
$ adb mysql sg
$ adb mysql sh
`)
21 changes: 21 additions & 0 deletions cmd/manual.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,25 @@ var s3Command = &cobra.Command{
},
}

var awkCommand = &cobra.Command{
Use: "awk",
Short: "awk tools",
Long: "awk tools",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(adblib.AwkDoc)
},
}

var sedCommand = &cobra.Command{
Use: "sed",
Short: "sed tools",
Long: "sed tools",
Example: AirdbWiki,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(adblib.SedDoc)
},
}

func initManCommand() {
rootCmd.AddCommand(manCommand)

Expand All @@ -182,4 +201,6 @@ func initManCommand() {
manCommand.AddCommand(perfCommand)
manCommand.AddCommand(wrkCommand)
manCommand.AddCommand(s3Command)
manCommand.AddCommand(awkCommand)
manCommand.AddCommand(sedCommand)
}
Loading

0 comments on commit 128a02f

Please sign in to comment.