Skip to content

Commit

Permalink
rename aoc for aoctl
Browse files Browse the repository at this point in the history
Signed-off-by: Rodolfo Sanchez <[email protected]>
  • Loading branch information
dolfolife committed Sep 24, 2023
1 parent 95a88e8 commit 60784d0
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ builds:
- "amd64"
- "arm"
- "arm64"
ldflags:
- "-s -w -X 'cmd/aoctl.version={{.Version}}' -X 'cmd/aoctl.commit={{.Commit}}' -X 'cmd/aoctl.date={{.Date}}' -X 'cmd/aoctl.build={{.Tag}}'"
project_name: aoctl
release:
github:
Expand Down
2 changes: 1 addition & 1 deletion cmd/aoc/init.go → cmd/aoctl/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package aoc
package aoctl

import (

Expand Down
2 changes: 1 addition & 1 deletion cmd/aoc/puzzle.go → cmd/aoctl/puzzle.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package aoc
package aoctl

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/aoc/root.go → cmd/aoctl/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package aoc
package aoctl

import (
"fmt"
Expand Down
18 changes: 12 additions & 6 deletions cmd/aoc/version.go → cmd/aoctl/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package aoc
package aoctl

import (
"fmt"

// goVersion "go.hein.dev/go-version"
goVersion "go.hein.dev/go-version"
"github.com/spf13/cobra"
)

Expand All @@ -39,10 +39,16 @@ var (
Use: "version",
Short: "version of the Advent of Code CLI",
Run: func(cmd *cobra.Command, args []string) {
//resp := goVersion.FuncWithOutput(shortened, version, commit, date, output)
fmt.Printf("my app %s, commit %s, built at %s", version, commit, date)
//fmt.Print(resp)
return
var response string
versionOutput := goVersion.New(version, commit, date)

if shortened {
response = versionOutput.ToShortened()
} else {
response = versionOutput.ToJSON()
}
fmt.Printf("%+v", response)
return
},
}
)
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ go 1.20
require (
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
go.hein.dev/go-version v0.1.0
golang.org/x/net v0.13.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
)
138 changes: 138 additions & 0 deletions go.sum

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package main

import "github.com/dolfolife/aoctl/cmd/aoc"
import (
"github.com/dolfolife/aoctl/cmd/aoctl"
)

func main() {
aoc.Execute()
aoctl.Execute()
}

0 comments on commit 60784d0

Please sign in to comment.