-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): fix option truncate -> delete
- Loading branch information
1 parent
6899127
commit b871cd1
Showing
11 changed files
with
47 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
*.jsonl | ||
!testdata/*.jsonl | ||
.docker | ||
ddbrew | ||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
lint: | ||
staticcheck ./... | ||
|
||
clean: | ||
-rm ddbrew | ||
BIN := ddbrew | ||
VERSION := $(shell git describe --tags) | ||
REVISION := $(shell git rev-parse --short HEAD) | ||
|
||
build: | ||
go build ./cmd/ddbrew/ddbrew.go | ||
|
||
test: | ||
go test | ||
|
||
all: lint test | ||
go build -ldflags="-s -w -X github.com/shuntaka9576/$(BIN)/cli.Version=$(VERSION) -X github.com/shuntaka9576/$(BIN)/cli.Revision=$(REVISION)" -o ddbrew ./cmd/$(BIN) | ||
|
||
.PHONY: lint build clean test all | ||
.PHONY: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package cli | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/alecthomas/kong" | ||
) | ||
|
||
var Version string | ||
var Revision = "HEAD" | ||
|
||
var embedVersion = "0.0.1" | ||
|
||
type VersionFlag string | ||
|
||
func (v VersionFlag) Decode(ctx *kong.DecodeContext) error { return nil } | ||
func (v VersionFlag) IsBool() bool { return true } | ||
func (v VersionFlag) BeforeApply(app *kong.Kong, vars kong.Vars) error { | ||
if Version == "" { | ||
Version = embedVersion | ||
} | ||
fmt.Printf("ddbrew version %s (rev:%s)\n", Version, Revision) | ||
app.Exit(0) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters