Skip to content

Commit

Permalink
Added --quietonsuccess command line option.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 28, 2004
1 parent 4a1d016 commit 6e577e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mojopatch.c
Expand Up @@ -158,6 +158,7 @@ static int interactive = 0;
static int replace = 0;
static int appending = 0;
static int alwaysadd = 0;
static int quietonsuccess = 0;
static PatchCommands command = COMMAND_NONE;

static const char *patchfile = NULL;
Expand Down Expand Up @@ -1782,7 +1783,8 @@ static int create_patchfile(void)
_fatal("THE FILE [%s] IS LIKELY INCOMPLETE. DO NOT USE!", patchfile);
else
{
ui_success("Patchfile successfully created.");
if (!quietonsuccess)
ui_success("Patchfile successfully created.");
_log("%ld bytes in the file [%s].", fsize, patchfile);
} /* else */

Expand Down Expand Up @@ -1938,7 +1940,7 @@ static int do_patching(void)

retval = PATCHSUCCESS;
ui_total_progress(100);
if (!info_only())
if ( (!info_only()) && (!quietonsuccess) )
ui_success("Patching successful!");

do_patching_done:
Expand Down Expand Up @@ -1971,6 +1973,7 @@ static int do_usage(const char *argv0)
_log(" --replace (specify ADDs overwrite, at create time or override)");
_log(" --append (creation appends to existing patchfile)");
_log(" --alwaysadd (put ADDs instead of PATCHs into the patchfile)");
_log(" --quietonsuccess (Don't do msgbox on successful finish)");
_log(" --readme (README filename to display/install)");
_log(" --renamedir (What patched dir should be called)");
_log(" --titlebar (What UI's window's titlebar should say)");
Expand Down Expand Up @@ -2039,6 +2042,8 @@ static int parse_cmdline(int argc, char **argv)
appending = 1;
else if (strcmp(argv[i], "--alwaysadd") == 0)
alwaysadd = 1;
else if (strcmp(argv[i], "--quietonsuccess") == 0)
quietonsuccess = 1;
else if (strcmp(argv[i], "--product") == 0)
make_static_string(header.product, argv[++i]);
else if (strcmp(argv[i], "--identifier") == 0)
Expand Down Expand Up @@ -2109,6 +2114,7 @@ static int parse_cmdline(int argc, char **argv)
_dlog("ADDs are %spermitted to REPLACE.", (replace) ? "" : "NOT ");
_dlog("Created patch will %sbe appended.", (appending) ? "" : "NOT ");
_dlog("%sse ADDs instead of PATCHs.", (alwaysadd) ? "U" : "Do NOT u");
_dlog("%seport success in UI", (quietonsuccess) ? "Don't r" : "R");
_dlog("command == (%d).", (int) command);
_dlog("(%d) nonoptions:", nonoptcount);
for (i = 0; i < nonoptcount; i++)
Expand Down

0 comments on commit 6e577e6

Please sign in to comment.