Skip to content

Commit

Permalink
Merge branch 'main' of github.com:confetti-framework/commands into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Reindert Vetter committed Mar 6, 2021
2 parents 745f97b + dd04972 commit edb4d29
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,47 @@

# Confetti Commands

Use this code for your CLI project. Particularly suitable for a CI project.
Use this template for your CLI project. Particularly suitable for a CI project.

> This code contains a few files to get started on your CLI project. If you want more functionalities, it is better to use [Confetti Framework](https://github.com/confetti-framework/confetti).
## Documentation

Confetti Commands has extensive and thorough [documentation](https://www.confetti-framework.com/docs/digging-deeper/commands), making it a breeze to get started.

## Example

``` go
package commands

import (
"src/app/support"
"github.com/confetti-framework/contract/inter"
"io"
)

type SendEmails struct {
Email string `flag:"email" required:"true"`
}

func (s SendEmails) Name() string {
return "mail:send"
}

func (s SendEmails) Description() string {
return "Send a marketing email to a user."
}

func (s SendEmails) Handle(c inter.Cli) inter.ExitCode {
mailer := support.DripEmailer{}
mailer.Send(s.Email)

c.Info("Email send to: %s", s.Email)

return inter.Success
}
```

## License

Confetti is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

0 comments on commit edb4d29

Please # to comment.