-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathancod.1
112 lines (112 loc) · 2.2 KB
/
ancod.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
.\" ancod - generate formatted strings using ansi codes
.\" Copyright (C) 2024 Guilherme Puida
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see <https://www.gnu.org/licenses/>.
.Dd $Mdocdate: March 04 2024 $
.Dt ANCOD 1
.Os
.Sh NAME
.Nm ancod
.Md generate formatted strings using ansi codes
.Sh SYNOPSIS
.Nm ancod
.Op Fl fhnrv
.Op Ar STRING...
.Sh DESCRIPTION
.Nm
generates formatted string using ansi codes.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl f
Force styled output, overriding the NO_COLOR environment variable.
.It Fl h
Print help message and exit.
.It Fl n
Do not output the trailing newline.
.It Fl r
Do not reset styles after every input.
.It Fl v
Print version information and exit.
.El
.Pp
Supported tags are as follows:
.Pp
.Bl -tag -width "[*COLOR]" -compact
.It Bq /
reset all.
.It Bq ^COLOR
set foreground color to
.Sy COLOR.
.It Bq /^
reset foreground color to default.
.It Bq *COLOR
set background color to
.Sy COLOR.
.It Bq /*
reset background color to default.
.It Bq b
bold.
.It Bq /b
no bold.
.It Bq d
dim.
.It Bq /d
no dim.
.It Bq i
italic.
.It Bq /i
no italic.
.It Bq u
underline.
.It Bq /u
no underline.
.It Bq s
strikethrough.
.It Bq /s
no strikethrough.
.El
.Pp
Where
.Sy COLOR
can be one of:
.Pp
.Bl -dash -compact
.It
black
.It
red
.It
green
.It
yellow
.It
blue
.It
magenta
.It
cyan
.It
white
.El
.Pp
Tags can be escaped with a single backslash before the opening bracket. Any
other escape sequence will be ignored.
.Pp
Invalid tags will be output as-is.
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev NO_COLOR
If set to anything, disable all output styling. Valid tags will still be
consumed and will not be present in the output.