Skip to content

Styled output

Brandon Jordan edited this page Mar 12, 2023 · 5 revisions

Styled Output

ttuy.Style("Text", ttuy.Bold, ttuy.Green) // returns string
Screen Shot 2022-09-23 at 14 06 15

Pre-styled output

Output

Success message

// Success
ttuy.Success("Done!")

var success = "Done!"
ttuy.Successf("%s", success)

Info message

// Info
ttuy.Info("FYI!")
var info = "FYI!"
ttuy.Infof("%s", info)

Warning message

// Warning
ttuy.Warn("Unable to do something!")
var warning = "Unable to do something!"
ttuy.Warnf("%s", warning)

Error message

// Error
ttuy.Fail("Unable to do something!")

var _, err = os.ReadDir("doesntExist")
ttuy.FailErr("Label", err)

var message = "Unable to do something!"
ttuy.Failf("%s", message)

Banners

Small Banner

Banner(message) returns a banner around message made of # signs.

Banner("Title")
Screenshot 2023-03-11 at 23 12 18

Big Banner

BigBanner(message) returns a box around message made of # signs.

BigBanner("Title")
Screenshot 2023-03-11 at 23 12 13

Both banners are the width of the terminal window.

Clone this wiki locally