SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / src / bin / lttng / utils.c
index 81e93952ad139ad9466a9723099a7884d0911c5c..680d24134cf49d6d58ab6c43cdb4784ed6d2fe04 100644 (file)
@@ -1,18 +1,8 @@
 /*
- * Copyright (c)  2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #define _LGPL_SOURCE
@@ -138,6 +128,25 @@ void list_cmd_options(FILE *ofp, struct poptOption *options)
        }
 }
 
+/*
+ * Same as list_cmd_options, but for options specified for argpar.
+ */
+void list_cmd_options_argpar(FILE *ofp, const struct argpar_opt_descr *options)
+{
+       int i;
+       const struct argpar_opt_descr *option = NULL;
+
+       for (i = 0; options[i].long_name != NULL; i++) {
+               option = &options[i];
+
+               fprintf(ofp, "--%s\n", option->long_name);
+
+               if (isprint(option->short_name)) {
+                       fprintf(ofp, "-%c\n", option->short_name);
+               }
+       }
+}
+
 /*
  * fls: returns the position of the most significant bit.
  * Returns 0 if no bit is set, else returns the position of the most
This page took 0.025799 seconds and 5 git commands to generate.