+void print_help(char const * const name)
+{
+ printf("Syntax: %s image_file [list of commands]\n\n", name);
+ printf("Commands: [Note: both '/' and '-' are accepted as command prefixes.] \n");
+ printf(" /format <sectors> [<filesystem>] Formats the disk image.\n");
+ printf(" /boot <sector file> Writes a new boot sector.\n");
+ printf(" /add <src path> <dst path> Copies an external file or directory\n"
+ " into the image.\n");
+ printf(" /extract <src path> <dst path> Copies a file or directory from the image\n"
+ " into an external file or directory.\n");
+ printf(" /move <src path> <new path> Moves/renames a file or directory.\n");
+ printf(" /copy <src path> <new path> Copies a file or directory.\n");
+ printf(" /mkdir <src path> <new path> Creates a directory.\n");
+ printf(" /rmdir <src path> <new path> Creates a directory.\n");
+ printf(" /list [<pattern>] Lists files a directory (defaults to root).\n");
+ //printf(" /recursive Enables recursive processing for directories.\n");
+}
+
+#define PRINT_HELP_AND_QUIT() \
+ do { \
+ ret = 1; \
+ print_help(oargv[0]); \
+ goto exit; \
+ } while (0)
+