Fossil SCM

I have "ls"-ified "list" subcommands for my personal use-case before -- roll through code and convert others for sake of consistency

bch 2014-09-03 20:25 trunk
Commit ce6de743c2157016d5a3947d2c62966ffd9d557c
+2 -2
--- src/cache.c
+++ src/cache.c
@@ -238,11 +238,11 @@
238238
**
239239
** clear Remove all entries from the cache.
240240
**
241241
** init Create the cache file it it does not already exists.
242242
**
243
-** list List the keys and content sizes and other stats for
243
+** list|ls List the keys and content sizes and other stats for
244244
** all entries currently in the cache
245245
**
246246
** status Show a summary of cache status.
247247
**
248248
** The cache is stored in a file that is distinct from the repository
@@ -282,11 +282,11 @@
282282
sqlite3_close(db);
283283
fossil_print("cache cleared\n");
284284
}else{
285285
fossil_print("nothing to clear; cache does not exist\n");
286286
}
287
- }else if( strncmp(zCmd, "list", nCmd)==0 ){
287
+ }else if(( strncmp(zCmd, "list", nCmd)==0 ) || ( strncmp(zCmd, "ls", nCmd)==0 )){
288288
db = cacheOpen(0);
289289
if( db==0 ){
290290
fossil_print("cache does not exist\n");
291291
}else{
292292
int nEntry = 0;
293293
--- src/cache.c
+++ src/cache.c
@@ -238,11 +238,11 @@
238 **
239 ** clear Remove all entries from the cache.
240 **
241 ** init Create the cache file it it does not already exists.
242 **
243 ** list List the keys and content sizes and other stats for
244 ** all entries currently in the cache
245 **
246 ** status Show a summary of cache status.
247 **
248 ** The cache is stored in a file that is distinct from the repository
@@ -282,11 +282,11 @@
282 sqlite3_close(db);
283 fossil_print("cache cleared\n");
284 }else{
285 fossil_print("nothing to clear; cache does not exist\n");
286 }
287 }else if( strncmp(zCmd, "list", nCmd)==0 ){
288 db = cacheOpen(0);
289 if( db==0 ){
290 fossil_print("cache does not exist\n");
291 }else{
292 int nEntry = 0;
293
--- src/cache.c
+++ src/cache.c
@@ -238,11 +238,11 @@
238 **
239 ** clear Remove all entries from the cache.
240 **
241 ** init Create the cache file it it does not already exists.
242 **
243 ** list|ls List the keys and content sizes and other stats for
244 ** all entries currently in the cache
245 **
246 ** status Show a summary of cache status.
247 **
248 ** The cache is stored in a file that is distinct from the repository
@@ -282,11 +282,11 @@
282 sqlite3_close(db);
283 fossil_print("cache cleared\n");
284 }else{
285 fossil_print("nothing to clear; cache does not exist\n");
286 }
287 }else if(( strncmp(zCmd, "list", nCmd)==0 ) || ( strncmp(zCmd, "ls", nCmd)==0 )){
288 db = cacheOpen(0);
289 if( db==0 ){
290 fossil_print("cache does not exist\n");
291 }else{
292 int nEntry = 0;
293
+3 -1
--- src/tkt.c
+++ src/tkt.c
@@ -1053,14 +1053,16 @@
10531053
** Instead of the report title its possible to use the report
10541054
** number. Using the special report number 0 list all columns,
10551055
** defined in the ticket table.
10561056
**
10571057
** %fossil ticket list fields
1058
+** %fossil ticket ls fields
10581059
**
10591060
** list all fields, defined for ticket in the fossil repository
10601061
**
10611062
** %fossil ticket list reports
1063
+** %fossil ticket ls reports
10621064
**
10631065
** list all ticket reports, defined in the fossil repository
10641066
**
10651067
** %fossil ticket set TICKETUUID (FIELD VALUE)+ ?-q|--quote?
10661068
** %fossil ticket change TICKETUUID (FIELD VALUE)+ ?-q|--quote?
@@ -1123,11 +1125,11 @@
11231125
n = strlen(g.argv[2]);
11241126
if( n==1 && g.argv[2][0]=='s' ){
11251127
/* set/show cannot be distinguished, so show the usage */
11261128
usage("add|change|list|set|show|history");
11271129
}
1128
- if( strncmp(g.argv[2],"list",n)==0 ){
1130
+ if(( strncmp(g.argv[2],"list",n)==0 ) || ( strncmp(g.argv[2],"ls",n)==0 )){
11291131
if( g.argc==3 ){
11301132
usage("list fields|reports");
11311133
}else{
11321134
n = strlen(g.argv[3]);
11331135
if( !strncmp(g.argv[3],"fields",n) ){
11341136
--- src/tkt.c
+++ src/tkt.c
@@ -1053,14 +1053,16 @@
1053 ** Instead of the report title its possible to use the report
1054 ** number. Using the special report number 0 list all columns,
1055 ** defined in the ticket table.
1056 **
1057 ** %fossil ticket list fields
 
1058 **
1059 ** list all fields, defined for ticket in the fossil repository
1060 **
1061 ** %fossil ticket list reports
 
1062 **
1063 ** list all ticket reports, defined in the fossil repository
1064 **
1065 ** %fossil ticket set TICKETUUID (FIELD VALUE)+ ?-q|--quote?
1066 ** %fossil ticket change TICKETUUID (FIELD VALUE)+ ?-q|--quote?
@@ -1123,11 +1125,11 @@
1123 n = strlen(g.argv[2]);
1124 if( n==1 && g.argv[2][0]=='s' ){
1125 /* set/show cannot be distinguished, so show the usage */
1126 usage("add|change|list|set|show|history");
1127 }
1128 if( strncmp(g.argv[2],"list",n)==0 ){
1129 if( g.argc==3 ){
1130 usage("list fields|reports");
1131 }else{
1132 n = strlen(g.argv[3]);
1133 if( !strncmp(g.argv[3],"fields",n) ){
1134
--- src/tkt.c
+++ src/tkt.c
@@ -1053,14 +1053,16 @@
1053 ** Instead of the report title its possible to use the report
1054 ** number. Using the special report number 0 list all columns,
1055 ** defined in the ticket table.
1056 **
1057 ** %fossil ticket list fields
1058 ** %fossil ticket ls fields
1059 **
1060 ** list all fields, defined for ticket in the fossil repository
1061 **
1062 ** %fossil ticket list reports
1063 ** %fossil ticket ls reports
1064 **
1065 ** list all ticket reports, defined in the fossil repository
1066 **
1067 ** %fossil ticket set TICKETUUID (FIELD VALUE)+ ?-q|--quote?
1068 ** %fossil ticket change TICKETUUID (FIELD VALUE)+ ?-q|--quote?
@@ -1123,11 +1125,11 @@
1125 n = strlen(g.argv[2]);
1126 if( n==1 && g.argv[2][0]=='s' ){
1127 /* set/show cannot be distinguished, so show the usage */
1128 usage("add|change|list|set|show|history");
1129 }
1130 if(( strncmp(g.argv[2],"list",n)==0 ) || ( strncmp(g.argv[2],"ls",n)==0 )){
1131 if( g.argc==3 ){
1132 usage("list fields|reports");
1133 }else{
1134 n = strlen(g.argv[3]);
1135 if( !strncmp(g.argv[3],"fields",n) ){
1136
+2 -1
--- src/user.c
+++ src/user.c
@@ -197,10 +197,11 @@
197197
**
198198
** Query or set the default user. The default user is the
199199
** user for command-line interaction.
200200
**
201201
** %fossil user list
202
+** %fossil user ls
202203
**
203204
** List all users known to the repository
204205
**
205206
** %fossil user new ?USERNAME? ?CONTACT-INFO? ?PASSWORD?
206207
**
@@ -261,11 +262,11 @@
261262
db_lset("default-user", g.argv[3]);
262263
}else{
263264
db_set("default-user", g.argv[3], 0);
264265
}
265266
}
266
- }else if( n>=2 && strncmp(g.argv[2],"list",n)==0 ){
267
+ }else if(( n>=2 && strncmp(g.argv[2],"list",n)==0 ) || ( n>=2 && strncmp(g.argv[2],"ls",n)==0 )){
267268
Stmt q;
268269
db_prepare(&q, "SELECT login, info FROM user ORDER BY login");
269270
while( db_step(&q)==SQLITE_ROW ){
270271
fossil_print("%-12s %s\n", db_column_text(&q, 0), db_column_text(&q, 1));
271272
}
272273
--- src/user.c
+++ src/user.c
@@ -197,10 +197,11 @@
197 **
198 ** Query or set the default user. The default user is the
199 ** user for command-line interaction.
200 **
201 ** %fossil user list
 
202 **
203 ** List all users known to the repository
204 **
205 ** %fossil user new ?USERNAME? ?CONTACT-INFO? ?PASSWORD?
206 **
@@ -261,11 +262,11 @@
261 db_lset("default-user", g.argv[3]);
262 }else{
263 db_set("default-user", g.argv[3], 0);
264 }
265 }
266 }else if( n>=2 && strncmp(g.argv[2],"list",n)==0 ){
267 Stmt q;
268 db_prepare(&q, "SELECT login, info FROM user ORDER BY login");
269 while( db_step(&q)==SQLITE_ROW ){
270 fossil_print("%-12s %s\n", db_column_text(&q, 0), db_column_text(&q, 1));
271 }
272
--- src/user.c
+++ src/user.c
@@ -197,10 +197,11 @@
197 **
198 ** Query or set the default user. The default user is the
199 ** user for command-line interaction.
200 **
201 ** %fossil user list
202 ** %fossil user ls
203 **
204 ** List all users known to the repository
205 **
206 ** %fossil user new ?USERNAME? ?CONTACT-INFO? ?PASSWORD?
207 **
@@ -261,11 +262,11 @@
262 db_lset("default-user", g.argv[3]);
263 }else{
264 db_set("default-user", g.argv[3], 0);
265 }
266 }
267 }else if(( n>=2 && strncmp(g.argv[2],"list",n)==0 ) || ( n>=2 && strncmp(g.argv[2],"ls",n)==0 )){
268 Stmt q;
269 db_prepare(&q, "SELECT login, info FROM user ORDER BY login");
270 while( db_step(&q)==SQLITE_ROW ){
271 fossil_print("%-12s %s\n", db_column_text(&q, 0), db_column_text(&q, 1));
272 }
273
+2 -1
--- src/wiki.c
+++ src/wiki.c
@@ -1041,10 +1041,11 @@
10411041
**
10421042
** Create a new wiki page with initial content taken from
10431043
** FILE or from standard input.
10441044
**
10451045
** %fossil wiki list
1046
+** %fossil wiki ls
10461047
**
10471048
** Lists all wiki entries, one per line, ordered
10481049
** case-insensitively by name.
10491050
**
10501051
*/
@@ -1131,11 +1132,11 @@
11311132
}else if( strncmp(g.argv[2],"delete",n)==0 ){
11321133
if( g.argc!=5 ){
11331134
usage("delete PAGENAME");
11341135
}
11351136
fossil_fatal("delete not yet implemented.");
1136
- }else if( strncmp(g.argv[2],"list",n)==0 ){
1137
+ }else if(( strncmp(g.argv[2],"list",n)==0 ) || ( strncmp(g.argv[2],"ls",n)==0 )){
11371138
Stmt q;
11381139
db_prepare(&q,
11391140
"SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'"
11401141
" ORDER BY lower(tagname) /*sort*/"
11411142
);
11421143
--- src/wiki.c
+++ src/wiki.c
@@ -1041,10 +1041,11 @@
1041 **
1042 ** Create a new wiki page with initial content taken from
1043 ** FILE or from standard input.
1044 **
1045 ** %fossil wiki list
 
1046 **
1047 ** Lists all wiki entries, one per line, ordered
1048 ** case-insensitively by name.
1049 **
1050 */
@@ -1131,11 +1132,11 @@
1131 }else if( strncmp(g.argv[2],"delete",n)==0 ){
1132 if( g.argc!=5 ){
1133 usage("delete PAGENAME");
1134 }
1135 fossil_fatal("delete not yet implemented.");
1136 }else if( strncmp(g.argv[2],"list",n)==0 ){
1137 Stmt q;
1138 db_prepare(&q,
1139 "SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'"
1140 " ORDER BY lower(tagname) /*sort*/"
1141 );
1142
--- src/wiki.c
+++ src/wiki.c
@@ -1041,10 +1041,11 @@
1041 **
1042 ** Create a new wiki page with initial content taken from
1043 ** FILE or from standard input.
1044 **
1045 ** %fossil wiki list
1046 ** %fossil wiki ls
1047 **
1048 ** Lists all wiki entries, one per line, ordered
1049 ** case-insensitively by name.
1050 **
1051 */
@@ -1131,11 +1132,11 @@
1132 }else if( strncmp(g.argv[2],"delete",n)==0 ){
1133 if( g.argc!=5 ){
1134 usage("delete PAGENAME");
1135 }
1136 fossil_fatal("delete not yet implemented.");
1137 }else if(( strncmp(g.argv[2],"list",n)==0 ) || ( strncmp(g.argv[2],"ls",n)==0 )){
1138 Stmt q;
1139 db_prepare(&q,
1140 "SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'"
1141 " ORDER BY lower(tagname) /*sort*/"
1142 );
1143

Keyboard Shortcuts

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