Fossil SCM
I have "ls"-ified "list" subcommands for my personal use-case before -- roll through code and convert others for sake of consistency
Commit
ce6de743c2157016d5a3947d2c62966ffd9d557c
Parent
214b1d0a37487c9…
4 files changed
+2
-2
+3
-1
+2
-1
+2
-1
+2
-2
| --- src/cache.c | ||
| +++ src/cache.c | ||
| @@ -238,11 +238,11 @@ | ||
| 238 | 238 | ** |
| 239 | 239 | ** clear Remove all entries from the cache. |
| 240 | 240 | ** |
| 241 | 241 | ** init Create the cache file it it does not already exists. |
| 242 | 242 | ** |
| 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 | |
| 244 | 244 | ** all entries currently in the cache |
| 245 | 245 | ** |
| 246 | 246 | ** status Show a summary of cache status. |
| 247 | 247 | ** |
| 248 | 248 | ** The cache is stored in a file that is distinct from the repository |
| @@ -282,11 +282,11 @@ | ||
| 282 | 282 | sqlite3_close(db); |
| 283 | 283 | fossil_print("cache cleared\n"); |
| 284 | 284 | }else{ |
| 285 | 285 | fossil_print("nothing to clear; cache does not exist\n"); |
| 286 | 286 | } |
| 287 | - }else if( strncmp(zCmd, "list", nCmd)==0 ){ | |
| 287 | + }else if(( strncmp(zCmd, "list", nCmd)==0 ) || ( strncmp(zCmd, "ls", nCmd)==0 )){ | |
| 288 | 288 | db = cacheOpen(0); |
| 289 | 289 | if( db==0 ){ |
| 290 | 290 | fossil_print("cache does not exist\n"); |
| 291 | 291 | }else{ |
| 292 | 292 | int nEntry = 0; |
| 293 | 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 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 @@ | ||
| 1053 | 1053 | ** Instead of the report title its possible to use the report |
| 1054 | 1054 | ** number. Using the special report number 0 list all columns, |
| 1055 | 1055 | ** defined in the ticket table. |
| 1056 | 1056 | ** |
| 1057 | 1057 | ** %fossil ticket list fields |
| 1058 | +** %fossil ticket ls fields | |
| 1058 | 1059 | ** |
| 1059 | 1060 | ** list all fields, defined for ticket in the fossil repository |
| 1060 | 1061 | ** |
| 1061 | 1062 | ** %fossil ticket list reports |
| 1063 | +** %fossil ticket ls reports | |
| 1062 | 1064 | ** |
| 1063 | 1065 | ** list all ticket reports, defined in the fossil repository |
| 1064 | 1066 | ** |
| 1065 | 1067 | ** %fossil ticket set TICKETUUID (FIELD VALUE)+ ?-q|--quote? |
| 1066 | 1068 | ** %fossil ticket change TICKETUUID (FIELD VALUE)+ ?-q|--quote? |
| @@ -1123,11 +1125,11 @@ | ||
| 1123 | 1125 | n = strlen(g.argv[2]); |
| 1124 | 1126 | if( n==1 && g.argv[2][0]=='s' ){ |
| 1125 | 1127 | /* set/show cannot be distinguished, so show the usage */ |
| 1126 | 1128 | usage("add|change|list|set|show|history"); |
| 1127 | 1129 | } |
| 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 )){ | |
| 1129 | 1131 | if( g.argc==3 ){ |
| 1130 | 1132 | usage("list fields|reports"); |
| 1131 | 1133 | }else{ |
| 1132 | 1134 | n = strlen(g.argv[3]); |
| 1133 | 1135 | if( !strncmp(g.argv[3],"fields",n) ){ |
| 1134 | 1136 |
| --- 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 @@ | ||
| 197 | 197 | ** |
| 198 | 198 | ** Query or set the default user. The default user is the |
| 199 | 199 | ** user for command-line interaction. |
| 200 | 200 | ** |
| 201 | 201 | ** %fossil user list |
| 202 | +** %fossil user ls | |
| 202 | 203 | ** |
| 203 | 204 | ** List all users known to the repository |
| 204 | 205 | ** |
| 205 | 206 | ** %fossil user new ?USERNAME? ?CONTACT-INFO? ?PASSWORD? |
| 206 | 207 | ** |
| @@ -261,11 +262,11 @@ | ||
| 261 | 262 | db_lset("default-user", g.argv[3]); |
| 262 | 263 | }else{ |
| 263 | 264 | db_set("default-user", g.argv[3], 0); |
| 264 | 265 | } |
| 265 | 266 | } |
| 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 )){ | |
| 267 | 268 | Stmt q; |
| 268 | 269 | db_prepare(&q, "SELECT login, info FROM user ORDER BY login"); |
| 269 | 270 | while( db_step(&q)==SQLITE_ROW ){ |
| 270 | 271 | fossil_print("%-12s %s\n", db_column_text(&q, 0), db_column_text(&q, 1)); |
| 271 | 272 | } |
| 272 | 273 |
| --- 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 @@ | ||
| 1041 | 1041 | ** |
| 1042 | 1042 | ** Create a new wiki page with initial content taken from |
| 1043 | 1043 | ** FILE or from standard input. |
| 1044 | 1044 | ** |
| 1045 | 1045 | ** %fossil wiki list |
| 1046 | +** %fossil wiki ls | |
| 1046 | 1047 | ** |
| 1047 | 1048 | ** Lists all wiki entries, one per line, ordered |
| 1048 | 1049 | ** case-insensitively by name. |
| 1049 | 1050 | ** |
| 1050 | 1051 | */ |
| @@ -1131,11 +1132,11 @@ | ||
| 1131 | 1132 | }else if( strncmp(g.argv[2],"delete",n)==0 ){ |
| 1132 | 1133 | if( g.argc!=5 ){ |
| 1133 | 1134 | usage("delete PAGENAME"); |
| 1134 | 1135 | } |
| 1135 | 1136 | 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 )){ | |
| 1137 | 1138 | Stmt q; |
| 1138 | 1139 | db_prepare(&q, |
| 1139 | 1140 | "SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'" |
| 1140 | 1141 | " ORDER BY lower(tagname) /*sort*/" |
| 1141 | 1142 | ); |
| 1142 | 1143 |
| --- 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 |