Skip to content

Commit

Permalink
cli: rename to cligen
Browse files Browse the repository at this point in the history
  • Loading branch information
avamsi committed Oct 13, 2023
1 parent 1a63f48 commit 45ac608
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/climate/go.mod → cmd/cligen/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/avamsi/climate/cmd/climate
module github.com/avamsi/climate/cmd/cligen

go 1.20

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions cmd/climate/main.go → cmd/cligen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ type parseOptions struct {
Debug bool // whether to print metadata
}

// climate recursively parses the metadata of all Go packages in the current
// cligen recursively parses the metadata of all Go packages in the current
// directory and its subdirectories, and writes it to the given output file.
//
//cli:usage climate [opts]
//cli:usage cligen [opts]
func parse(opts *parseOptions) {
var (
rootMd internal.RawMetadata
Expand Down Expand Up @@ -136,10 +136,10 @@ func parse(opts *parseOptions) {
// #nosec G306 -- G306 expects 0o600 or less but 0o644 is fine here as the
// metadata is not really sensitive (and is expected to be committed).
assert.Nil(os.WriteFile(opts.Out, rootMd.Encode(), 0o644))
fmt.Println("climate: (re)generated", opts.Out)
fmt.Println("cligen: (re)generated", opts.Out)
}

//go:generate go run github.com/avamsi/climate/cmd/climate --out=md.cli
//go:generate go run github.com/avamsi/climate/cmd/cligen --out=md.cli
//go:embed md.cli
var md []byte

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions cmd/examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ go 1.20

require (
github.com/avamsi/climate v0.0.0
github.com/avamsi/climate/cmd/climate v0.0.0
github.com/avamsi/climate/cmd/cligen v0.0.0
github.com/google/go-cmp v0.5.9
)

replace (
github.com/avamsi/climate v0.0.0 => ../..
github.com/avamsi/climate/cmd/climate v0.0.0 => ../climate
github.com/avamsi/climate/cmd/cligen v0.0.0 => ../cligen
)

require (
Expand Down
2 changes: 1 addition & 1 deletion cmd/examples/greet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func greet(opts *greetOptions) {

// * These only work if you generate and pass along "metadata" like below --

//go:generate go run github.com/avamsi/climate/cmd/climate --out=md.cli
//go:generate go run github.com/avamsi/climate/cmd/cligen --out=md.cli
//go:embed md.cli
var md []byte

Expand Down
2 changes: 1 addition & 1 deletion cmd/examples/jj/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (g *git) Export() {
fmt.Println("export", g.J)
}

//go:generate go run github.com/avamsi/climate/cmd/climate --out=md.cli
//go:generate go run github.com/avamsi/climate/cmd/cligen --out=md.cli
//go:embed md.cli
var md []byte

Expand Down
2 changes: 1 addition & 1 deletion cmd/examples/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package tools

import _ "github.com/avamsi/climate/cmd/climate"
import _ "github.com/avamsi/climate/cmd/cligen"
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ go 1.20

use (
.
./cmd/climate
./cmd/cligen
./cmd/examples
)

0 comments on commit 45ac608

Please sign in to comment.