summaryrefslogtreecommitdiff
path: root/hardinfo2
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2006-11-26 20:46:49 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2006-11-26 20:46:49 +0000
commit96d673a3ba61dcdd348b422b2b9f2e1158cd6286 (patch)
treedf01db43604c868dce456135205905481d847e29 /hardinfo2
parentbdebb25ba5dcd9727cfbef5dd8b7a77ba9030a9c (diff)
Cleanups
Diffstat (limited to 'hardinfo2')
-rwxr-xr-xhardinfo2/configure2
-rw-r--r--hardinfo2/hardinfo.c54
-rw-r--r--hardinfo2/util.c14
3 files changed, 43 insertions, 27 deletions
diff --git a/hardinfo2/configure b/hardinfo2/configure
index a9d90300..e1829be1 100755
--- a/hardinfo2/configure
+++ b/hardinfo2/configure
@@ -168,7 +168,7 @@ echo "#define HOSTNAME \"`hostname`\"" >> config.h
echo "#define PREFIX \"/usr/share/hardinfo/\"" >> config.h
echo "#define LIBPREFIX \"/usr/lib/hardinfo/\"" >> config.h
echo "#define DEBUG 1" >> config.h
-echo "#define ENABLE_BINRELOC" >> config.h
+echo "#define ENABLE_BINRELOC 1" >> config.h
echo "#define RELEASE $RELEASE" >> config.h
echo -e "\n#endif /* __CONFIG_H__ */" >> config.h
diff --git a/hardinfo2/hardinfo.c b/hardinfo2/hardinfo.c
index 32118cbc..668f4d31 100644
--- a/hardinfo2/hardinfo.c
+++ b/hardinfo2/hardinfo.c
@@ -38,44 +38,60 @@ main(int argc, char **argv)
/* show version information and quit */
if (params.show_version) {
- g_print("HardInfo version " VERSION "\n");
- g_print("Copyright (C) 2003-2006 Leandro A. F. Pereira. See COPYING for details.\n");
+ g_print("HardInfo version " VERSION "\n");
+ g_print("Copyright (C) 2003-2006 Leandro A. F. Pereira. See COPYING for details.\n\n");
- return 0;
+ g_print("Compile-time options:\n"
+ " Release version: %s\n"
+ " BinReloc enabled: %s\n"
+ " Data prefix: %s\n"
+ " Library prefix: %s\n"
+ " Compiled on: %s %s (%s)\n"
+ " Debugging enabled: %s\n\n",
+ RELEASE ? "Yes" : "No (" VERSION ")",
+ ENABLE_BINRELOC ? "Yes" : "No",
+ PREFIX,
+ LIBPREFIX,
+ PLATFORM, KERNEL, HOSTNAME,
+ DEBUG ? "Yes" : "No");
+
+ /* show also available modules */
+ params.list_modules = TRUE;
}
-
+
/* initialize the binreloc library, so we can load program data */
if (!binreloc_init(FALSE))
g_error("Failed to find runtime data.\n\n"
"\342\200\242 Is HardInfo correctly installed?\n"
"\342\200\242 See if %s and %s exists and you have read permision.",
PREFIX, LIBPREFIX);
-
+
/* list all module names */
if (params.list_modules) {
- GSList *modules = modules_load_all();
+ g_print("Modules:\n"
+ "%-20s%s\n", "File Name", "Name");
- for (; modules; modules = modules->next) {
- ShellModule *module = (ShellModule *) modules->data;
- gchar *name = g_path_get_basename(g_module_name(module->dll));
+ for (modules = modules_load_all(); modules; modules = modules->next) {
+ ShellModule *module = (ShellModule *) modules->data;
+ gchar *name = g_path_get_basename(g_module_name(module->dll));
- g_print("%s (%s)\n", name, module->name);
+ g_print("%-20s%s\n", name, module->name);
- g_free(name);
+ g_free(name);
}
return 0;
}
-
+
if (!params.create_report) {
- /* we only try to open the UI if the user didn't asked for a
- report. */
- params.gui_running = ui_init(&argc, &argv);
+ /* we only try to open the UI if the user didn't asked for a
+ report. */
+ params.gui_running = ui_init(&argc, &argv);
- /* as a fallback, if GTK+ initialization failed, run in report
- generation mode. */
- if (!params.gui_running)
- params.create_report = TRUE;
+ /* as a fallback, if GTK+ initialization failed, run in report
+ generation mode. */
+ if (!params.gui_running)
+ params.create_report = TRUE;
}
if (params.use_modules) {
diff --git a/hardinfo2/util.c b/hardinfo2/util.c
index da3a338b..67b17985 100644
--- a/hardinfo2/util.c
+++ b/hardinfo2/util.c
@@ -258,11 +258,11 @@ log_handler(const gchar * log_domain,
void parameters_init(int *argc, char ***argv, ProgramParameters * param)
{
- static gboolean create_report = FALSE;
- static gboolean show_version = FALSE;
- static gboolean list_modules = FALSE;
- static gchar *report_format = NULL;
- static gchar **use_modules = NULL;
+ static gboolean create_report = FALSE;
+ static gboolean show_version = FALSE;
+ static gboolean list_modules = FALSE;
+ static gchar *report_format = NULL;
+ static gchar **use_modules = NULL;
static GOptionEntry options[] = {
{
@@ -287,11 +287,11 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param)
.description = "lists modules"
},
{
- .long_name = "load-modules",
+ .long_name = "load-module",
.short_name = 'm',
.arg = G_OPTION_ARG_STRING_ARRAY,
.arg_data = &use_modules,
- .description = "load only selected modules"
+ .description = "specify module file name to load; may be used more than once"
},
{
.long_name = "version",