/* vi: set sw=4 ts=4: */
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "autoconf.h"
#define SKIP_applet_main
#define ALIGN1 /* nothing, just to placate applet_tables.h */
#define ALIGN2 /* nothing, just to placate applet_tables.h */
#include "applet_tables.h"
/* Since we can't use platform.h, have to do this again by hand: */
#if ENABLE_NOMMU
# define BB_MMU 0
# define USE_FOR_NOMMU(...) __VA_ARGS__
# define USE_FOR_MMU(...)
#else
# define BB_MMU 1
# define USE_FOR_NOMMU(...)
# define USE_FOR_MMU(...) __VA_ARGS__
#endif
#include "usage.h"
#define MAKE_USAGE(aname, usage) { aname, usage },
static struct usage_data {
const char *aname;
const char *usage;
} usage_array[] = {
#include "applets.h"
};
static int compare_func(const void *a, const void *b)
{
const struct usage_data *ua = a;
const struct usage_data *ub = b;
return strcmp(ua->aname, ub->aname);
}
int main(void)
{
int col, len2;
int i;
int num_messages = sizeof(usage_array) / sizeof(usage_array[0]);
if (num_messages == 0)
return 0;
qsort(usage_array,
num_messages, sizeof(usage_array[0]),
compare_func);
col = 0;
for (i = 0; i < num_messages; i++) {
len2 = strlen(usage_array[i].aname) + 2;
if (col >= 76 - len2) {
printf(",\n");
col = 0;
}
if (col == 0) {
col = 6;
printf("\t");
} else {
printf(", ");
}
printf(usage_array[i].aname);
col += len2;
}
printf("\n\n");
printf("=head1 COMMAND DESCRIPTIONS\n\n");
printf("=over 4\n\n");
for (i = 0; i < num_messages; i++) {
if (usage_array[i].aname[0] >= 'a' && usage_array[i].aname[0] <= 'z'
&& usage_array[i].usage[0] != NOUSAGE_STR[0]
) {
printf("=item B<%s>\n\n", usage_array[i].aname);
if (usage_array[i].usage[0])
printf("%s %s\n\n", usage_array[i].aname, usage_array[i].usage);
else
printf("%s\n\n", usage_array[i].aname);
}
}
return 0;
}
/* TODO: we used to make options bold with B<> and output an example too:
=item B<cat>
cat [B<-u>] [FILE]...
Concatenate FILE(s) and print them to stdout
Options:
-u Use unbuffered i/o (ignored)
Example:
$ cat /proc/uptime
110716.72 17.67
*/
我虽横行却不霸道
- 粉丝: 95
- 资源: 1万+
最新资源
- 俞敏洪:企业的文化基因需要一开始就注入.docx
- 政钧企业文化诊断学之 :企业家个人文化力不足.docx
- STM32串口下载软件(FLYMCU)
- 红枣疏花机(含工程图sw18可编辑+cad)全套技术开发资料100%好用.zip
- 基于web的网上演唱会票务管理系统.doc
- Python面向对象.xmind
- 中职学校《Windows Server网络操作系统》课程标准及教学指导(2024年版)
- 基于java的物流信息网的设计与实现论文.doc
- 中职学校《Java程序设计》课程标准及教学指导(2024年版)
- Python面向对象进阶.xmind
- 中职学校《Android Studio程序设计》课程标准及教学指导(2024年版)
- ReST-MCTS∗: LLM Self-Training via Process Reward Guided Tree Search
- 基于java的音乐交流平台论文.doc
- pptssssssss
- 中职学校《物联网网关Qt程序编写》课程标准及教学指导(2024年版)
- 基于web的银行业务管理系统.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈