예제 #1
0
파일: iw.c 프로젝트: 62gs8ha/batphone
static void usage(bool full)
{
	const struct cmd *section, *cmd;

	printf("Usage:\t%s [options] command\n", argv0);
	usage_options();
	printf("\t--version\tshow version (%s)\n", iw_version);
	printf("Commands:\n");
	for_each_cmd(section) {
		if (section->parent)
			continue;

		if (section->handler && !section->hidden)
			__usage_cmd(section, "\t", full);

		for_each_cmd(cmd) {
			if (section != cmd->parent)
				continue;
			if (!cmd->handler || cmd->hidden)
				continue;
			__usage_cmd(cmd, "\t", full);
		}
	}
	printf("\nYou can omit the 'phy' or 'dev' if "
			"the identification is unique,\n"
			"e.g. \"iw wlan0 info\" or \"iw phy0 info\". "
			"(Don't when scripting.)\n\n"
			"Do NOT screenscrape this tool, we don't "
			"consider its output stable.\n\n");
}
예제 #2
0
static void usage(int argc, char **argv)
{
	const struct cmd *section, *cmd;
	bool full = argc >= 0;
	const char *sect_filt = NULL;
	const char *cmd_filt = NULL;

	if (argc > 0)
		sect_filt = argv[0];

	if (argc > 1)
		cmd_filt = argv[1];

	printf("Usage:\t%s [options] command\n", argv0);
	usage_options();
#if ofnouse
	printf("\t--version\tshow version (%s)\n", iw_version);
#endif

	printf("Commands:\n");
	for_each_cmd(section) {
		if (section->parent)
			continue;

		if (sect_filt && strcmp(section->name, sect_filt))
			continue;

		if (section->handler && !section->hidden)
			__usage_cmd(section, "\t", full);

		for_each_cmd(cmd) {
			if (section != cmd->parent)
				continue;
			if (!cmd->handler || cmd->hidden)
				continue;
			if (cmd_filt && strcmp(cmd->name, cmd_filt))
				continue;
			__usage_cmd(cmd, "\t", full);
		}
	}
	printf("\nCommands that use the netdev ('dev') can also be given the\n"
	       "'wdev' instead to identify the device.\n");
	printf("\nYou can omit the 'phy' or 'dev' if "
			"the identification is unique,\n"
			"e.g. \"iw wlan0 info\" or \"iw phy0 info\". "
			"(Don't when scripting.)\n\n"
			"Do NOT screenscrape this tool, we don't "
			"consider its output stable.\n\n");
}
예제 #3
0
static void usage(bool full)
{
	const struct cmd *section, *cmd;

	printf("Usage:\t%s [options] command\n", argv0);
	usage_options();
	printf("Commands:\n");
	for_each_cmd(section) {
		if (section->parent)
			continue;

		if (section->handler && !section->hidden)
			__usage_cmd(section, "\t", full);

		for_each_cmd(cmd) {
			if (section != cmd->parent)
				continue;
			if (!cmd->handler || cmd->hidden)
				continue;
			__usage_cmd(cmd, "\t", full);
		}
	}
}
예제 #4
0
파일: c2tool.c 프로젝트: merbanan/c2tool
static void usage(int argc, char **argv)
{
	const struct cmd *cmd;
	bool full = argc >= 0;
	const char *cmd_filt = NULL;

	if (argc > 0)
		cmd_filt = argv[0];

	printf("Usage:\t%s [options] <tty device> command\n", argv0);
	printf("\t--version\tshow version (%s)\n", c2tool_version);
	printf("Commands:\n");
	for_each_cmd(cmd) {
		if (!cmd->handler || cmd->hidden)
			continue;
		if (cmd_filt && strcmp(cmd->name, cmd_filt))
			continue;
		__usage_cmd(cmd, "\t", full);
	}
}
예제 #5
0
static void usage_cmd(const struct cmd *cmd)
{
	printf("Usage:\t%s [options] ", argv0);
	__usage_cmd(cmd, "", true);
	usage_options();
}