免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3009 | 回复: 9
打印 上一主题 下一主题

求教关于命令的help参数 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-17 08:43 |只看该作者 |倒序浏览
求教关于命令的help参数。
比如输入head --help
请问它是从哪里读取的help文件?

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2011-12-17 08:47 |只看该作者
这个应该是程序自己实现的help功能

论坛徽章:
0
3 [报告]
发表于 2011-12-17 08:52 |只看该作者
回复 2# chenyx


    应该不会,因为它显示的是中文

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
4 [报告]
发表于 2011-12-17 09:04 |只看该作者
帮助文档一般都放在/usr/share/man/下面的,你去找找

论坛徽章:
0
5 [报告]
发表于 2011-12-17 09:10 |只看该作者
回复 4# chenyx


    那里我找了,没找到中文的。
我问这个问题是因为:
使用man命令看到的是英文帮助
使用--help看到的是中文帮助
所以我比较奇怪。

论坛徽章:
3
CU十二周年纪念徽章
日期:2013-10-24 15:41:34狮子座
日期:2014-03-27 15:44:382015年辞旧岁徽章
日期:2015-03-03 16:54:15
6 [报告]
发表于 2011-12-17 12:47 |只看该作者
是不是系统语言改成了中文?可能是系统汉化了的,man读的文档没有变

论坛徽章:
0
7 [报告]
发表于 2011-12-17 20:41 |只看该作者
回复 6# cu_little_bird

我用的是deepin linux

论坛徽章:
0
8 [报告]
发表于 2011-12-17 23:18 |只看该作者
这个是汉化过的。不会所有的命令都有中文帮助

论坛徽章:
19
CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-09-18 15:15:15CU大牛徽章
日期:2013-05-20 10:46:44CU大牛徽章
日期:2013-05-20 10:46:38CU大牛徽章
日期:2013-05-20 10:46:31CU大牛徽章
日期:2013-05-20 10:46:25CU大牛徽章
日期:2013-05-20 10:46:18CU大牛徽章
日期:2013-04-17 11:19:51CU大牛徽章
日期:2013-04-17 11:19:42CU大牛徽章
日期:2013-04-17 11:19:37CU大牛徽章
日期:2013-04-17 11:19:32CU大牛徽章
日期:2013-04-17 11:19:28
9 [报告]
发表于 2011-12-18 14:51 |只看该作者
回复 1# hgyxb


摆渡一下吧

论坛徽章:
0
10 [报告]
发表于 2011-12-18 15:28 |只看该作者
回复 8# syre


    查了一下head程序的代码,
-----------------------
void
usage (int status)
{
  if (status != EXIT_SUCCESS)
    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
  else
    {
      printf (_("\
Usage: %s [OPTION]... [FILE]...\n\
"),
              program_name);
      fputs (_("\
Print the first 10 lines of each FILE to standard output.\n\
With more than one FILE, precede each with a header giving the file name.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), stdout);
      fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
      fputs (_("\
  -c, --bytes=[-]K         print the first K bytes of each file;\n\
                             with the leading `-', print all but the last\n\
                             K bytes of each file\n\
  -n, --lines=[-]K         print the first K lines instead of the first 10;\n\
                             with the leading `-', print all but the last\n\
                             K lines of each file\n\
"), stdout);
      fputs (_("\
  -q, --quiet, --silent    never print headers giving file names\n\
  -v, --verbose            always print headers giving file names\n\
"), stdout);
      fputs (HELP_OPTION_DESCRIPTION, stdout);
      fputs (VERSION_OPTION_DESCRIPTION, stdout);
      fputs (_("\
\n\
K may have a multiplier suffix:\n\
b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\
GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\
"), stdout);
      emit_ancillary_info ();
    }
  exit (status);
}
-----------------------
是使用gettext模块来实现的,gettext相应的文件夹估计有翻译文件。
man相应的文件夹内没有翻译文件。
不知为什么man没有封装中文翻译。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP