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) {...}
Commit
dccd27c6da34c08eda2040e38c8d1226e07bec85
Parent
70656d00f6a6f29…
2 files changed
+2
+4
-2
+2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -67,10 +67,11 @@ | ||
| 67 | 67 | int localOpen; /* True if the local database is open */ |
| 68 | 68 | char *zLocalRoot; /* The directory holding the local database */ |
| 69 | 69 | int minPrefix; /* Number of digits needed for a distinct UUID */ |
| 70 | 70 | int fSqlTrace; /* True if -sqltrace flag is present */ |
| 71 | 71 | int fSqlPrint; /* True if -sqlprint flag is present */ |
| 72 | + int fQuiet; /* True if -quiet flag is present */ | |
| 72 | 73 | int fHttpTrace; /* Trace outbound HTTP requests */ |
| 73 | 74 | int fNoSync; /* Do not do an autosync even. --nosync */ |
| 74 | 75 | char *zPath; /* Name of webpage being served */ |
| 75 | 76 | char *zExtra; /* Extra path information past the webpage name */ |
| 76 | 77 | char *zBaseURL; /* Full text of the URL being served */ |
| @@ -232,10 +233,11 @@ | ||
| 232 | 233 | zCmdName = "cgi"; |
| 233 | 234 | }else if( argc<2 ){ |
| 234 | 235 | fprintf(stderr, "Usage: %s COMMAND ...\n", argv[0]); |
| 235 | 236 | exit(1); |
| 236 | 237 | }else{ |
| 238 | + g.fQuiet = find_option("quiet", 0, 0)!=0; | |
| 237 | 239 | g.fSqlTrace = find_option("sqltrace", 0, 0)!=0; |
| 238 | 240 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 239 | 241 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 240 | 242 | g.zLogin = find_option("user", "U", 1); |
| 241 | 243 | zCmdName = argv[1]; |
| 242 | 244 |
| --- 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 @@ | ||
| 1070 | 1070 | if( blob_buffer(&xfer.line)[0]=='#' ){ |
| 1071 | 1071 | continue; |
| 1072 | 1072 | } |
| 1073 | 1073 | xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken)); |
| 1074 | 1074 | nCardRcvd++; |
| 1075 | - printf("\r%d", nCardRcvd); | |
| 1076 | - fflush(stdout); | |
| 1075 | + if (!g.fQuiet) { | |
| 1076 | + printf("\r%d", nCardRcvd); | |
| 1077 | + fflush(stdout); | |
| 1078 | + } | |
| 1077 | 1079 | |
| 1078 | 1080 | /* file UUID SIZE \n CONTENT |
| 1079 | 1081 | ** file UUID DELTASRC SIZE \n CONTENT |
| 1080 | 1082 | ** |
| 1081 | 1083 | ** Receive a file transmitted from the server. |
| 1082 | 1084 |
| --- 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 |