bximage_new: improvements for non-interactive (quiet) mode

- all operations now also working with one file name parameter
- suppress BX_INFO output in quiet mode
This commit is contained in:
Volker Ruppert 2013-10-20 07:30:36 +00:00
parent 4802fac2de
commit 0236e5f591
2 changed files with 7 additions and 6 deletions

View File

@ -65,11 +65,13 @@ enum {
#endif
#define BX_DEBUG(x)
#define BX_INFO(x) { (printf) x ; printf("\n"); }
#define BX_INFO(x) { if (bx_interactive) { (printf) x ; printf("\n"); } }
#define BX_ERROR(x) { (printf) x ; printf("\n"); }
#define BX_PANIC(x) { (printf) x ; printf("\n"); myexit(1); }
#define BX_ASSERT(x)
extern int bx_interactive;
class device_image_t;
void myexit(int code);

View File

@ -875,13 +875,12 @@ int parse_cmdline(int argc, char *argv[])
bx_interactive = 1;
} else {
set_default_values();
if (bximage_mode == BXIMAGE_MODE_CREATE_IMAGE) {
if (fnargs < 1) {
bx_interactive = 1;
}
} else if (fnargs < 2) {
if (fnargs < 1) {
bx_interactive = 1;
}
if ((bximage_mode == BXIMAGE_MODE_COMMIT_UNDOABLE) && (fnargs == 1)) {
snprintf(bx_filename_2, 256, "%s%s", bx_filename_1, UNDOABLE_REDOLOG_EXTENSION);
}
}
return ret;
}