gosh
gosh copied to clipboard
DONE! TODO delegate splash to a plugin
here you go! I figured this would be easier for the end user to config in my program if i did this, so i went ahead and did it, and took advantage of the load order, hence the file name
./plugins/00_splash.go
package main
import (
"context"
"fmt"
"github.com/vladimirvivien/gosh/api"
)
type splashCmd string
type splashCmds struct{}
func (t *splashCmds) Init(ctx context.Context) error {
// to set your splash, modify the text in the println statement below, multiline is supported
fmt.Println(`-------------------------`)
return nil
}
func (t *splashCmds) Registry() map[string]api.Command {
return map[string]api.Command{}
}
var Commands splashCmds
./gosh.go
remove these lines
// TODO delegate splash to a plugin
func (gosh *Goshell) printSplash() {
fmt.Println(`
888
888
888
.d88b. .d88b. .d8888b 88888b.
d88P"88bd88""88b88K 888 "88b
888 888888 888"Y8888b.888 888
Y88b 888Y88..88P X88888 888
"Y88888 "Y88P" 88888P'888 888
888
Y8b d88P
"Y88P"
`)
}
https://github.com/vladimirvivien/gosh/blob/master/gosh.go#L44
Hi @Merith-TK thanks. Do you have a PR for this change?
Not quite yet, will get one today. (6am at time of sending this email.
On Fri, Jan 10, 2020, 5:50 AM Vladimir Vivien [email protected] wrote:
Hi @Merith-TK https://github.com/Merith-TK thanks. Do you have a PR for this change?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vladimirvivien/gosh/issues/9?email_source=notifications&email_token=ACPQOXTXEXNY52YY4TWNWU3Q5B4JZA5CNFSM4KFBB4D2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIT7BIY#issuecomment-573042851, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPQOXTJQSESEJWBTH4G27TQ5B4JZANCNFSM4KFBB4DQ .
Opened PR,