Skip to content

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

@verdverm

Description

@verdverm

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)
		}
	},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions