summaryrefslogtreecommitdiff
path: root/hardinfo2/util.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2006-11-19 19:38:31 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2006-11-19 19:38:31 +0000
commit5e7c1a3a03269b5088b26ecf9c676518d65a05e4 (patch)
treed4b9b5c0731a252954a897892633d1f7f6c8fbc4 /hardinfo2/util.c
parent8708504c28caeee4bd3e95b6b6d739970863f19c (diff)
Run hardinfo with the '-r' command-line parameter and you'll get a report in standard output. :)
Diffstat (limited to 'hardinfo2/util.c')
-rw-r--r--hardinfo2/util.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/hardinfo2/util.c b/hardinfo2/util.c
index 295fe061..9ed9b8fc 100644
--- a/hardinfo2/util.c
+++ b/hardinfo2/util.c
@@ -17,6 +17,7 @@
*/
#include <config.h>
+#include <report.h>
#include <string.h>
#include <shell.h>
#include <iconcache.h>
@@ -257,16 +258,24 @@ log_handler(const gchar * log_domain,
void parameters_init(int *argc, char ***argv, ProgramParameters * param)
{
- static gboolean create_report = FALSE;
+ static gboolean create_report = FALSE;
+ static gchar *report_format = NULL;
static GOptionEntry options[] = {
{
- .long_name = "create-report",
+ .long_name = "generate-report",
.short_name = 'r',
.arg = G_OPTION_ARG_NONE,
.arg_data = &create_report,
.description = "create a report and print to standard output"
},
+ {
+ .long_name = "report-format",
+ .short_name = 'f',
+ .arg = G_OPTION_ARG_STRING,
+ .arg_data = &report_format,
+ .description = "choose a report format (text, html)"
+ },
{ NULL }
};
GOptionContext *ctx;
@@ -281,6 +290,10 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param)
g_option_context_free(ctx);
param->create_report = create_report;
+ param->report_format = REPORT_FORMAT_TEXT;
+
+ if (report_format && g_str_equal(report_format, "html"))
+ param->report_format = REPORT_FORMAT_HTML;
}
gboolean ui_init(int *argc, char ***argv)