Skip to content
Myr

command.go

This file

Path

man/command.go

25 lines · 711 bytes · Go

Last changed by

fix: lint issues (#909)Carlos Alexandro Beckerbefore adoption817c4bd

History of this file

Take it

The walk stopped after 200 commits: lines older than 6837ed2 point at it.

fix: lint issues (#909)Carlos Alexandro Beckerbefore adoption817c4bd

line 1why, one step back
1// Package man the man command.

feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2

lines 2–25why, one step back
2package man
34import (5 "fmt"67 "github.com/alecthomas/kong"8 mangokong "github.com/alecthomas/mango-kong"9 "github.com/muesli/roff"10)1112// Man is a gum sub-command that generates man pages.13type Man struct{}1415// BeforeApply implements Kong BeforeApply hook.16func (m Man) BeforeApply(ctx *kong.Context) error {17 // Set the correct man pages description without color escape sequences.18 ctx.Model.Help = "A tool for glamorous shell scripts."19 man := mangokong.NewManPage(1, ctx.Model)20 man = man.WithSection("Copyright", "(c) 2022-2024 Charmbracelet, Inc.\n"+21 "Released under MIT license.")22 _, _ = fmt.Fprint(ctx.Stdout, man.Build(roff.NewDocument()))23 ctx.Exit(0)24 return nil25}