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

Lightweight command syntax #8

Open
tucnak opened this issue Nov 10, 2016 · 1 comment
Open

Lightweight command syntax #8

tucnak opened this issue Nov 10, 2016 · 1 comment

Comments

@tucnak
Copy link
Owner

tucnak commented Nov 10, 2016

We need a super lightweight syntax of creating simple flag-less commands. Something like this would be great:

app := climax.New("appname")

app.Comm("command", "i am command", func (ctx climax.Context) {
    return 0;
});
@ccpaging
Copy link

Try:

type Application struct {
	Version string // `1.5`
	Command

	Commands []*Command
	Topics   []*Topic
	Groups   []*Group

	// Default is a default handler. It gets executed if there are
	// no command line arguments (except the program name), when
	// otherwise, by default, the help entry is being shown.
	Default CmdHandler

	ungroupedCmdsCount int
}

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

2 participants