hofstadter-io / hofmod-cli Goto Github PK
View Code? Open in Web Editor NEWHofstadter generator for Golang CLIs
Home Page: https://github.com/hofstadter-io/hof
License: BSD 3-Clause "New" or "Revised" License
Hofstadter generator for Golang CLIs
Home Page: https://github.com/hofstadter-io/hof
License: BSD 3-Clause "New" or "Revised" License
Long
help as Go embedI'm explicitly setting the schema fields to false
:
#CLI: schema.#Cli & {
Name: "test"
Package: "example.com/test/test/cmd/test"
Short: "a test"
CompletionCommands: false
Updates: false
OmitRun: false
Pflags: [...schema.#Flag] & [{
Name: "test"
Long: "test"
Short: "t"
Type: "string"
Default: ""
Help: "test test test"
}]
// Commands: []
}
and while they are not added to the Cmd
in root.go
the actual commands still get generated:
cmd/test
├── cmd
│ ├── completions.go
│ ├── hls
│ │ └── cli
│ │ └── root
│ │ └── help.hls
│ ├── root.go
│ ├── root_test.go
│ ├── update.go
│ └── version.go
├── flags
│ └── root.go
├── main.go
└── verinfo
└── verinfo.go
which makes the build fail like this:
building go files...
go build -o test ./cmd/test
go: finding module for package example.com/test/test/cmd/test/ga
cmd/test/cmd/completions.go:8:2: cannot find module providing package example.com/test/test/cmd/test/ga: module example.com/test/test/cmd/test/ga: git ls-remote -q origin in /home/user/go/pkg/mod/cache/vcs/BLAAAAAAAAAA: exit status 128:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
make: *** [Makefile:10: build] Error 1
(vendor here means we should start adding a level of hierarchy for vendor/company -> tools / projects / configs / etc)
Add support for [config,secret] X [global, local] files / dirs.
also incorp Cosign
add a default included version command that integrates with goreleaser variables
Cobra needs to be updated too
https://github.com/spf13/cobra/blob/master/shell_completions.md#bash-completion-v2
This below was generated from, not sure why the rest is there? I think we use it to pass remaining args to the template, but where is the config? Did I put this in manually?
#CreateCommand: schema.#Command & {
Name: "create"
Usage: "create <module location>"
Short: "dynamic blueprints from any git repo"
Long: #CreateRootHelp
Args: [{
Name: "module"
Type: "string"
Required: false
Help: "git repository or directory with a creator, accepts subdirs on both"
}]
Run: func(cmd *cobra.Command, args []string) {
var err error
// Argument Parsing
var module string
if 0 < len(args) {
module = args[0]
}
err = CreateRun(module, args[1:])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
},
Cobra does it...
Add necessary parts to support Goreleaser
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.