From bb477316f1eb7946a1ab156c18b835cd537b0a2c Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sun, 10 Dec 2023 11:17:21 +0100 Subject: [PATCH] Some small bximage quiet mode changes. - Show error message if a parameter is missing for quiet mode. - Show defaults in help message. - Added quiet mode example in manual page. --- bochs/doc/man/bximage.1 | 6 +++++- bochs/misc/bximage.cc | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bochs/doc/man/bximage.1 b/bochs/doc/man/bximage.1 index 920722637..e0256bdd6 100644 --- a/bochs/doc/man/bximage.1 +++ b/bochs/doc/man/bximage.1 @@ -1,5 +1,5 @@ .\"Document Author: Timothy R. Butler - tbutler@uninetsolutions.com" -.TH bximage 1 "9 Jan 2021" "bximage" "The Bochs Project" +.TH bximage 1 "10 Dec 2023" "bximage" "The Bochs Project" .\"SKIP_SECTION" .SH NAME bximage \- Interactive Disk Image Creation, Conversion, Resize and @@ -52,6 +52,10 @@ option bximage uses the command line parameters as defaults for the interactive mode. If this option is given and one of the required parameters is missing, bximage will fall back to interactive mode. + +This example creates a harddisk image in flat mode and sector size 512: + +bximage -q -func=create -hd=100M hd100meg.img .TP .BI \--help Print a summary of the command line options for diff --git a/bochs/misc/bximage.cc b/bochs/misc/bximage.cc index 5fdaab2c8..23ea5a5af 100644 --- a/bochs/misc/bximage.cc +++ b/bochs/misc/bximage.cc @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2001-2021 The Bochs Project +// Copyright (C) 2001-2023 The Bochs Project // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -548,8 +548,8 @@ void print_usage() " -fd=... create: floppy image with size code\n" " -hd=... create/resize: hard disk image with size in megabytes (M)\n" " or gigabytes (G)\n" - " -imgmode=... create/convert: hard disk image mode\n" - " -sectsize=... create: hard disk sector size\n" + " -imgmode=... create/convert: hard disk image mode (default = flat)\n" + " -sectsize=... create: hard disk sector size (default = 512)\n" " -b convert/resize: create a backup of the source image\n" " commit: create backups of the base image and redolog file\n" " -q quiet mode (don't prompt for user input)\n" @@ -704,11 +704,13 @@ int parse_cmdline(int argc, char *argv[]) arg++; } if (bximage_func == BXIMAGE_FUNC_NULL) { + printf("\nERROR: Parameter -func missing - switching to interactive mode.\n\n"); bx_interactive = 1; } else { set_default_values(); if (fnargs < 1) { bx_interactive = 1; + printf("\nERROR; Filename missing - switching to interactive mode.\n\n"); } if ((bximage_func == BXIMAGE_FUNC_COMMIT_UNDOABLE) && (fnargs == 1)) { snprintf(bx_filename_2, 520, "%s%s", bx_filename_1, UNDOABLE_REDOLOG_EXTENSION);