Instead of needing to run the commands manually in main.go, we can implement the `Run(...) error` method to satisfy the command interface so that `kong` can Run our commands for us.
This commit uses the embedded style struct for styling in all components. The most notable example is `gum write` where there are many styles that are used and composed for each component of the command.
The magic example shows the user a bash magic trick by asking them to choose a card and then showing them their card.
A script never reveals its secrets. (unless you look at ./examples/magic.sh)
gum choose allows the user to be prompted for a choice from a list of choices.
For example, let's ask the user to pick a card from a deck.
gum choose --height 15 {Ace,King,Queen,Jack,Ten,Nine,Eight,Seven,Six,Five,Four,Three,Two}" of "{Spades,Hearts,Clubs,Diamonds}
This commit adds usage examples to the README.md on how users can use
gum in their workflows. In fact, this commit message is being created
through the `gum write` command as shown in the example!
Write provides a shell script interface for the text area bubble. It can
be used to ask the user to write some long form of text (multi-line)
input. The text the user entered will be sent to stdout.
```
gum write > output.text
```
Style provides a shell script interface for Lip Gloss. It allows you to
use Lip Gloss to style text without needing to use Go. All of the
styling options are available as flags.
Let's make some text glamorous using bash:
```
gum style \
--foreground "#FF06B7" --border "double" \
--margin 2 --padding "2 4" --width 50 \
"And oh gosh, how delicious the fabulous frizzy frobscottle" \
"was! It was sweet and refreshing. It tasted of vanilla and" \
"cream, with just the faintest trace of raspberries on the" \
"edge of the flavour. And the bubbles were wonderful."
```
Output:
```
╔══════════════════════════════════════════════════╗
║ ║
║ ║
║ And oh gosh, how delicious the fabulous ║
║ frizzy frobscottle was It was sweet and ║
║ refreshing. It tasted of vanilla and ║
║ cream, with just the faintest trace of ║
║ raspberries on the edge of the flavour. ║
║ And the bubbles were wonderful. ║
║ ║
║ ║
╚══════════════════════════════════════════════════╝
```