X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=main.c;h=4b030e929bb341255fabeaa8c2161270a0b8ccb4;hb=b98a91bf2ef4c8189dd9b483ed530e95f79ba53c;hp=f2f2e18685d7f0774dabbd550660dab395426b1d;hpb=453d8afffd406850f399a493f1f542dbc6da2b30;p=project%2Fuqmi.git diff --git a/main.c b/main.c index f2f2e18..4b030e9 100644 --- a/main.c +++ b/main.c @@ -18,6 +18,7 @@ static const char *device; #define __uqmi_command(_name, _optname, _arg, _option) { #_optname, _arg##_argument, NULL, CMD_OPT(__UQMI_COMMAND_##_name) } static const struct option uqmi_getopt[] = { __uqmi_commands, + { "single", no_argument, NULL, 's' }, { "device", required_argument, NULL, 'd' }, { "keep-client-id", required_argument, NULL, 'k' }, { "release-client-id", required_argument, NULL, 'r' }, @@ -29,6 +30,7 @@ static int usage(const char *progname) { fprintf(stderr, "Usage: %s \n" "Options:\n" + " --single, -s: Print output as a single line (for scripts)\n" " --device=NAME, -d NAME: Set device name to NAME (required)\n" " --keep-client-id : Keep Client ID for service \n" " (implies --keep-client-id)\n" @@ -84,7 +86,7 @@ int main(int argc, char **argv) signal(SIGINT, handle_exit_signal); signal(SIGTERM, handle_exit_signal); - while ((ch = getopt_long(argc, argv, "d:k:", uqmi_getopt, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "d:k:s", uqmi_getopt, NULL)) != -1) { int cmd_opt = CMD_OPT(ch); if (ch < 0 && cmd_opt >= 0 && cmd_opt < __UQMI_COMMAND_LAST) { @@ -102,6 +104,9 @@ int main(int argc, char **argv) case 'd': device = optarg; break; + case 's': + single_line = true; + break; default: return usage(argv[0]); }