]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
Refactor headers
[wimlib] / programs / imagex.c
index 591714e1684222a5b8f320025a3dfba7fbee7700..b45d2d4b99232e0c2d1ba4daf3445318d58967e5 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#  include "config.h" /* Need for PACKAGE_VERSION, etc. */
+#endif
+
 #include "wimlib.h"
 #include "wimlib_tchar.h"
 
@@ -40,7 +43,7 @@
 #include <locale.h>
 
 #ifdef HAVE_ALLOCA_H
-#include <alloca.h>
+#  include <alloca.h>
 #endif
 
 #ifdef __WIN32__
@@ -80,7 +83,7 @@ enum imagex_op_type {
 };
 
 static void usage(int cmd_type);
-static void usage_all();
+static void usage_all(void);
 
 static bool imagex_be_quiet = false;
 
@@ -169,7 +172,7 @@ IMAGEX_PROGNAME" unmount DIRECTORY [--commit] [--check] [--rebuild]\n"
 ),
 [UPDATE] =
 T(
-IMAGEX_PROGNAME" update WIMFILE IMAGE [--check] [--rebuild]\n"
+IMAGEX_PROGNAME" update WIMFILE [IMAGE_NUM | IMAGE_NAME] [--check] [--rebuild]\n"
 "                       [--threads=NUM_THREADS] [DEFAULT_ADD_OPTIONS]\n"
 "                       [DEFAULT_DELETE_OPTIONS] < CMDFILE\n"
 ),
@@ -179,14 +182,15 @@ IMAGEX_PROGNAME" update WIMFILE IMAGE [--check] [--rebuild]\n"
 static void
 recommend_man_page(const tchar *cmd_name)
 {
+       const tchar *format_str;
 #ifdef __WIN32__
-       tprintf(T("See "IMAGEX_PROGNAME"-%"TS".pdf in the "
-                 "doc directory for more details.\n"),
-               cmd_name);
+       format_str = T("See "IMAGEX_PROGNAME"%"TS"%"TS".pdf in the "
+                      "doc directory for more details.\n");
 #else
-       tprintf(T("Try `man "IMAGEX_PROGNAME"-%"TS"' "
-                 "for more details.\n"), cmd_name);
+       format_str = T("Try `man "IMAGEX_PROGNAME"%"TS"%"TS"' "
+                      "for more details.\n");
 #endif
+       tprintf(format_str, *cmd_name ? T("-") : T(""), cmd_name);
 }
 
 enum {
@@ -3109,7 +3113,7 @@ static const struct imagex_command imagex_commands[] = {
 };
 
 static void
-version()
+version(void)
 {
        static const tchar *s =
        T(
@@ -3172,7 +3176,7 @@ usage(int cmd_type)
 }
 
 static void
-usage_all()
+usage_all(void)
 {
        tfputs(T("Usage:\n"), stdout);
        for (int i = 0; i < ARRAY_LEN(usage_strings); i++)
@@ -3184,9 +3188,9 @@ usage_all()
 "\n"
 "    The compression TYPE may be \"maximum\", \"fast\", or \"none\".\n"
 "\n"
-"    Try `man "IMAGEX_PROGNAME"' for more information.\n"
        );
        tfputs(extra, stdout);
+       recommend_man_page(T(""));
 }
 
 /* Entry point for wimlib's ImageX implementation.  On UNIX the command