可能不是。实际上,手册页和其他文件是使用数据文件中的脚本构建的,但并未安装。
由于它是生成的,您可以编写一个脚本来提取信息,尽管您会发现将其作为bash
脚本来执行具有挑战性(perl 是,awk 是,sed...也许)。这是一小部分文本(安装在您的系统上):
.TS H
center expand;
c l l c
c l l c
lw25 lw6 lw2 lw20.
\fBVariable Cap- TCap Description\fR
\fBBooleans name Code\fR
auto_left_margin bw bw T{
cub1 wraps from column 0 to last column
T}
auto_right_margin am am T{
terminal has automatic margins
T}
back_color_erase bce ut T{
screen erased with background color
T}
can_change ccc cc
您始终可以使用 列出长名称,如果顺序与(默认)短infocmp
名称的顺序相同,您可以将它们组合起来。但是长名称的列表是按字母顺序排序的(按布尔值、数字和字符串分组,就像短名称一样),而短名称默认排序以匹配 SVr4 terminfo 数据。您可能会看到如下内容:
xterm-256color|xterm with 256 colors
am auto_right_margin
bce back_color_erase
ccc backspaces_with_bs
km can_change
mc5i eat_newline_glitch
mir has_meta_key
msgr move_insert_mode
npc move_standout_mode
xenl no_pad_char
colors prtr_silent
cols columns
it init_tabs
lines lines
pairs max_colors
acsc max_pairs
bel acs_chars
blink back_tab
bold bell
实际上 ncurses 有一个选项允许对名称进行排序,以便您可以(几乎)使用该-sl
选项匹配右列的顺序。您可能会看到如下内容:
xterm-256color|xterm with 256 colors
am auto_right_margin
bce back_color_erase
ccc backspaces_with_bs
xenl can_change
km eat_newline_glitch
mir has_meta_key
msgr move_insert_mode
npc move_standout_mode
mc5i no_pad_char
cols prtr_silent
it columns
lines init_tabs
colors lines
pairs max_colors
acsc max_pairs
cbt acs_chars
bel back_tab
cr bell
那是"几乎",因为列不对齐xenl
,eat_newline_glitch
因为 ncurses 有一个backspaces_with_bs
通常不显示的内部名称。更改 ncurses 源以显示:
xterm-256color|xterm with 256 colors
am auto_right_margin
bce back_color_erase
OTbs backspaces_with_bs
ccc can_change
xenl eat_newline_glitch
这是我用来生成示例的 perl 脚本:
#!/usr/bin/env perl
# $Id: infocmp2col,v 1.1 2018/12/20 22:35:57 tom Exp $
use strict;
use warnings;
sub infocmp($$) {
my $term = shift;
my $opts = shift;
my @data;
if ( open FP, "infocmp -1 $opts $term |" ) {
@data = <FP>;
close FP;
for my $n ( 0 .. $#data ) {
chomp $data[$n];
$data[$n] =~ s/,\s*$//;
$data[$n] =~ s/[#=].*//;
}
}
return \@data;
}
sub doit($) {
my $term = shift;
my @short_term = @{ &infocmp( $term, "-sl" ) };
my @long_term = @{ &infocmp( $term, "-L" ) };
for my $n ( 0 .. $#short_term ) {
if ( $short_term[$n] =~ /^\s/ ) {
printf "%s%s\n", $short_term[$n], $long_term[$n];
}
else {
printf "%s\n", $short_term[$n];
}
}
}
if ( $#ARGV >= 0 ) {
while ( $#ARGV >= 0 ) {
&doit( pop @ARGV );
}
}
else {
&doit( $ENV{TERM} );
}
1;
我提到的小修复在 ncurses 6.2 中(请参阅更改),因此这对大多数用户“应该有效”。