Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generated "rest" args will panic when the extra arg is not present #15

Open
verdverm opened this issue Mar 15, 2023 · 0 comments
Open

Comments

@verdverm
Copy link
Member

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)
		}
	},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant