1 Star 0 Fork 0

tfcolin/tz

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
workman.sh 854 Bytes
一键复制 编辑 原始数据 按行查看 历史
Paul Eggert 提交于 2022-08-10 23:50 . Port .txt generation to macOS
#! /bin/sh
# Convert manual page troff stdin to formatted .txt stdout.
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
if (type nroff && type perl) >/dev/null 2>&1; then
# Tell groff not to emit SGR escape sequences (ANSI color escapes).
GROFF_NO_SGR=1
export GROFF_NO_SGR
echo ".am TH
.hy 0
.na
..
.rm }H
.rm }F" | nroff -man - ${1+"$@"} | perl -ne '
binmode STDIN, '\'':encoding(utf8)'\'';
binmode STDOUT, '\'':encoding(utf8)'\'';
chomp;
s/.\010//g;
s/\s*$//;
if (/^$/) {
$sawblank = 1;
next;
} else {
if ($sawblank && $didprint) {
print "\n";
$sawblank = 0;
}
print "$_\n";
$didprint = 1;
}
'
elif (type mandoc && type col) >/dev/null 2>&1; then
mandoc -man -T ascii "$@" | col -bx
else
echo >&2 "$0: please install nroff and perl, or mandoc and col"
exit 1
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tfcolin/tz.git
git@gitee.com:tfcolin/tz.git
tfcolin
tz
tz
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385