Fossil SCM

Added a global command line argument named -quiet. This will suppress some output (currently during sync) for those interfacing fossil with various development tools. It does not make eliminate all output, only the output that is meant for fancy display to the user on a console. You can now use this new flag anywhere by referencing if (!g.fQuiet) {...}

Jeremy 2009-12-14 23:18 trunk
Commit dccd27c6da34c08eda2040e38c8d1226e07bec85
2 files changed +2 +4 -2
+2
--- src/main.c
+++ src/main.c
@@ -67,10 +67,11 @@
6767
int localOpen; /* True if the local database is open */
6868
char *zLocalRoot; /* The directory holding the local database */
6969
int minPrefix; /* Number of digits needed for a distinct UUID */
7070
int fSqlTrace; /* True if -sqltrace flag is present */
7171
int fSqlPrint; /* True if -sqlprint flag is present */
72
+ int fQuiet; /* True if -quiet flag is present */
7273
int fHttpTrace; /* Trace outbound HTTP requests */
7374
int fNoSync; /* Do not do an autosync even. --nosync */
7475
char *zPath; /* Name of webpage being served */
7576
char *zExtra; /* Extra path information past the webpage name */
7677
char *zBaseURL; /* Full text of the URL being served */
@@ -232,10 +233,11 @@
232233
zCmdName = "cgi";
233234
}else if( argc<2 ){
234235
fprintf(stderr, "Usage: %s COMMAND ...\n", argv[0]);
235236
exit(1);
236237
}else{
238
+ g.fQuiet = find_option("quiet", 0, 0)!=0;
237239
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
238240
g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
239241
g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
240242
g.zLogin = find_option("user", "U", 1);
241243
zCmdName = argv[1];
242244
--- src/main.c
+++ src/main.c
@@ -67,10 +67,11 @@
67 int localOpen; /* True if the local database is open */
68 char *zLocalRoot; /* The directory holding the local database */
69 int minPrefix; /* Number of digits needed for a distinct UUID */
70 int fSqlTrace; /* True if -sqltrace flag is present */
71 int fSqlPrint; /* True if -sqlprint flag is present */
 
72 int fHttpTrace; /* Trace outbound HTTP requests */
73 int fNoSync; /* Do not do an autosync even. --nosync */
74 char *zPath; /* Name of webpage being served */
75 char *zExtra; /* Extra path information past the webpage name */
76 char *zBaseURL; /* Full text of the URL being served */
@@ -232,10 +233,11 @@
232 zCmdName = "cgi";
233 }else if( argc<2 ){
234 fprintf(stderr, "Usage: %s COMMAND ...\n", argv[0]);
235 exit(1);
236 }else{
 
237 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
238 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
239 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
240 g.zLogin = find_option("user", "U", 1);
241 zCmdName = argv[1];
242
--- src/main.c
+++ src/main.c
@@ -67,10 +67,11 @@
67 int localOpen; /* True if the local database is open */
68 char *zLocalRoot; /* The directory holding the local database */
69 int minPrefix; /* Number of digits needed for a distinct UUID */
70 int fSqlTrace; /* True if -sqltrace flag is present */
71 int fSqlPrint; /* True if -sqlprint flag is present */
72 int fQuiet; /* True if -quiet flag is present */
73 int fHttpTrace; /* Trace outbound HTTP requests */
74 int fNoSync; /* Do not do an autosync even. --nosync */
75 char *zPath; /* Name of webpage being served */
76 char *zExtra; /* Extra path information past the webpage name */
77 char *zBaseURL; /* Full text of the URL being served */
@@ -232,10 +233,11 @@
233 zCmdName = "cgi";
234 }else if( argc<2 ){
235 fprintf(stderr, "Usage: %s COMMAND ...\n", argv[0]);
236 exit(1);
237 }else{
238 g.fQuiet = find_option("quiet", 0, 0)!=0;
239 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
240 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
241 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
242 g.zLogin = find_option("user", "U", 1);
243 zCmdName = argv[1];
244
+4 -2
--- src/xfer.c
+++ src/xfer.c
@@ -1070,12 +1070,14 @@
10701070
if( blob_buffer(&xfer.line)[0]=='#' ){
10711071
continue;
10721072
}
10731073
xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken));
10741074
nCardRcvd++;
1075
- printf("\r%d", nCardRcvd);
1076
- fflush(stdout);
1075
+ if (!g.fQuiet) {
1076
+ printf("\r%d", nCardRcvd);
1077
+ fflush(stdout);
1078
+ }
10771079
10781080
/* file UUID SIZE \n CONTENT
10791081
** file UUID DELTASRC SIZE \n CONTENT
10801082
**
10811083
** Receive a file transmitted from the server.
10821084
--- src/xfer.c
+++ src/xfer.c
@@ -1070,12 +1070,14 @@
1070 if( blob_buffer(&xfer.line)[0]=='#' ){
1071 continue;
1072 }
1073 xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken));
1074 nCardRcvd++;
1075 printf("\r%d", nCardRcvd);
1076 fflush(stdout);
 
 
1077
1078 /* file UUID SIZE \n CONTENT
1079 ** file UUID DELTASRC SIZE \n CONTENT
1080 **
1081 ** Receive a file transmitted from the server.
1082
--- src/xfer.c
+++ src/xfer.c
@@ -1070,12 +1070,14 @@
1070 if( blob_buffer(&xfer.line)[0]=='#' ){
1071 continue;
1072 }
1073 xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken));
1074 nCardRcvd++;
1075 if (!g.fQuiet) {
1076 printf("\r%d", nCardRcvd);
1077 fflush(stdout);
1078 }
1079
1080 /* file UUID SIZE \n CONTENT
1081 ** file UUID DELTASRC SIZE \n CONTENT
1082 **
1083 ** Receive a file transmitted from the server.
1084

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button