Fossil SCM

Formatting tweaks to the "dbstat" command so that it works better on an 80-column shell window.

drh 2013-02-15 16:15 trunk
Commit 8522e0ab02507f2e8800897ad64bfa192b4d0a9d
1 file changed +6 -6
+6 -6
--- src/stat.c
+++ src/stat.c
@@ -156,11 +156,11 @@
156156
int n, m;
157157
int szMax, szAvg;
158158
const char *zDb;
159159
int brief;
160160
char zBuf[100];
161
- const int colWidth = -20 /* printf alignment/width for left column */;
161
+ const int colWidth = -19 /* printf alignment/width for left column */;
162162
brief = find_option("brief", "b",0)!=0;
163163
db_find_and_open_repository(0,0);
164164
fsize = file_size(g.zRepositoryName);
165165
bigSizeName(sizeof(zBuf), zBuf, fsize);
166166
fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf );
@@ -179,12 +179,12 @@
179179
t = db_column_int64(&q, 0);
180180
szAvg = db_column_int(&q, 1);
181181
szMax = db_column_int(&q, 2);
182182
db_finalize(&q);
183183
bigSizeName(sizeof(zBuf), zBuf, t);
184
- fossil_print( "%*s%d bytes average, "
185
- "%d bytes max, %s total\n",
184
+ fossil_print( "%*s%d average, "
185
+ "%d max, %s total\n",
186186
colWidth, "artifact-sizes:",
187187
szAvg, szMax, zBuf);
188188
if( t/fsize < 5 ){
189189
b = 10;
190190
fsize /= 10;
@@ -214,20 +214,20 @@
214214
n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)"
215215
" + 0.99");
216216
fossil_print("%*s%d days or approximately %.2f years.\n",
217217
colWidth, "project-age:", n, n/365.2425);
218218
fossil_print("%*s%s\n", colWidth, "project-id:", db_get("project-code",""));
219
- fossil_print("%*s%s %s %s (%s)\n",
219
+ fossil_print("%*s%s %s [%s] (%s)\n",
220220
colWidth, "fossil-version:",
221
- RELEASE_VERSION, MANIFEST_DATE, MANIFEST_VERSION,
221
+ MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION,
222222
COMPILER_NAME);
223223
fossil_print("%*s%.19s [%.10s] (%s)\n",
224224
colWidth, "sqlite-version:",
225225
SQLITE_SOURCE_ID, &SQLITE_SOURCE_ID[20],
226226
SQLITE_VERSION);
227227
zDb = db_name("repository");
228
- fossil_print("%*s%d pages, %d bytes/page, %d free pages, "
228
+ fossil_print("%*s%d pages, %d bytes/pg, %d free pages, "
229229
"%s, %s mode\n",
230230
colWidth, "database-stats:",
231231
db_int(0, "PRAGMA %s.page_count", zDb),
232232
db_int(0, "PRAGMA %s.page_size", zDb),
233233
db_int(0, "PRAGMA %s.freelist_count", zDb),
234234
--- src/stat.c
+++ src/stat.c
@@ -156,11 +156,11 @@
156 int n, m;
157 int szMax, szAvg;
158 const char *zDb;
159 int brief;
160 char zBuf[100];
161 const int colWidth = -20 /* printf alignment/width for left column */;
162 brief = find_option("brief", "b",0)!=0;
163 db_find_and_open_repository(0,0);
164 fsize = file_size(g.zRepositoryName);
165 bigSizeName(sizeof(zBuf), zBuf, fsize);
166 fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf );
@@ -179,12 +179,12 @@
179 t = db_column_int64(&q, 0);
180 szAvg = db_column_int(&q, 1);
181 szMax = db_column_int(&q, 2);
182 db_finalize(&q);
183 bigSizeName(sizeof(zBuf), zBuf, t);
184 fossil_print( "%*s%d bytes average, "
185 "%d bytes max, %s total\n",
186 colWidth, "artifact-sizes:",
187 szAvg, szMax, zBuf);
188 if( t/fsize < 5 ){
189 b = 10;
190 fsize /= 10;
@@ -214,20 +214,20 @@
214 n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)"
215 " + 0.99");
216 fossil_print("%*s%d days or approximately %.2f years.\n",
217 colWidth, "project-age:", n, n/365.2425);
218 fossil_print("%*s%s\n", colWidth, "project-id:", db_get("project-code",""));
219 fossil_print("%*s%s %s %s (%s)\n",
220 colWidth, "fossil-version:",
221 RELEASE_VERSION, MANIFEST_DATE, MANIFEST_VERSION,
222 COMPILER_NAME);
223 fossil_print("%*s%.19s [%.10s] (%s)\n",
224 colWidth, "sqlite-version:",
225 SQLITE_SOURCE_ID, &SQLITE_SOURCE_ID[20],
226 SQLITE_VERSION);
227 zDb = db_name("repository");
228 fossil_print("%*s%d pages, %d bytes/page, %d free pages, "
229 "%s, %s mode\n",
230 colWidth, "database-stats:",
231 db_int(0, "PRAGMA %s.page_count", zDb),
232 db_int(0, "PRAGMA %s.page_size", zDb),
233 db_int(0, "PRAGMA %s.freelist_count", zDb),
234
--- src/stat.c
+++ src/stat.c
@@ -156,11 +156,11 @@
156 int n, m;
157 int szMax, szAvg;
158 const char *zDb;
159 int brief;
160 char zBuf[100];
161 const int colWidth = -19 /* printf alignment/width for left column */;
162 brief = find_option("brief", "b",0)!=0;
163 db_find_and_open_repository(0,0);
164 fsize = file_size(g.zRepositoryName);
165 bigSizeName(sizeof(zBuf), zBuf, fsize);
166 fossil_print( "%*s%s\n", colWidth, "repository-size:", zBuf );
@@ -179,12 +179,12 @@
179 t = db_column_int64(&q, 0);
180 szAvg = db_column_int(&q, 1);
181 szMax = db_column_int(&q, 2);
182 db_finalize(&q);
183 bigSizeName(sizeof(zBuf), zBuf, t);
184 fossil_print( "%*s%d average, "
185 "%d max, %s total\n",
186 colWidth, "artifact-sizes:",
187 szAvg, szMax, zBuf);
188 if( t/fsize < 5 ){
189 b = 10;
190 fsize /= 10;
@@ -214,20 +214,20 @@
214 n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)"
215 " + 0.99");
216 fossil_print("%*s%d days or approximately %.2f years.\n",
217 colWidth, "project-age:", n, n/365.2425);
218 fossil_print("%*s%s\n", colWidth, "project-id:", db_get("project-code",""));
219 fossil_print("%*s%s %s [%s] (%s)\n",
220 colWidth, "fossil-version:",
221 MANIFEST_DATE, MANIFEST_VERSION, RELEASE_VERSION,
222 COMPILER_NAME);
223 fossil_print("%*s%.19s [%.10s] (%s)\n",
224 colWidth, "sqlite-version:",
225 SQLITE_SOURCE_ID, &SQLITE_SOURCE_ID[20],
226 SQLITE_VERSION);
227 zDb = db_name("repository");
228 fossil_print("%*s%d pages, %d bytes/pg, %d free pages, "
229 "%s, %s mode\n",
230 colWidth, "database-stats:",
231 db_int(0, "PRAGMA %s.page_count", zDb),
232 db_int(0, "PRAGMA %s.page_size", zDb),
233 db_int(0, "PRAGMA %s.freelist_count", zDb),
234

Keyboard Shortcuts

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