Fossil SCM
Add option -v|--verbose to "fossil ls" as replacement for (deprecated) -l.
Commit
e91d65afe5a7441f7542ed67f3693ff6f231b6dd
Parent
122b631c31f46da…
1 file changed
+8
-5
+8
-5
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -219,27 +219,30 @@ | ||
| 219 | 219 | /* |
| 220 | 220 | ** COMMAND: ls |
| 221 | 221 | ** |
| 222 | 222 | ** Usage: %fossil ls ?OPTIONS? ?VERSION? |
| 223 | 223 | ** |
| 224 | -** Show the names of all files in the current checkout. The -l provides | |
| 224 | +** Show the names of all files in the current checkout. The -v provides | |
| 225 | 225 | ** extra information about each file. |
| 226 | 226 | ** |
| 227 | 227 | ** Options: |
| 228 | -** -l Provide extra information about each file. | |
| 229 | 228 | ** --age Show when each file was committed |
| 229 | +** -v|--verbose Provide extra information about each file. | |
| 230 | 230 | ** |
| 231 | 231 | ** See also: changes, extra, status |
| 232 | 232 | */ |
| 233 | 233 | void ls_cmd(void){ |
| 234 | 234 | int vid; |
| 235 | 235 | Stmt q; |
| 236 | - int isBrief; | |
| 236 | + int verboseFlag; | |
| 237 | 237 | int showAge; |
| 238 | 238 | char *zOrderBy = "pathname"; |
| 239 | 239 | |
| 240 | - isBrief = find_option("l","l", 0)==0; | |
| 240 | + verboseFlag = find_option("verbose","v", 0)!=0; | |
| 241 | + if(!verboseFlag){ | |
| 242 | + verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ | |
| 243 | + } | |
| 241 | 244 | showAge = find_option("age",0,0)!=0; |
| 242 | 245 | db_must_be_within_tree(); |
| 243 | 246 | vid = db_lget_int("checkout", 0); |
| 244 | 247 | if( find_option("t","t",0)!=0 ){ |
| 245 | 248 | if( showAge ){ |
| @@ -271,11 +274,11 @@ | ||
| 271 | 274 | int chnged = db_column_int(&q,3); |
| 272 | 275 | int renamed = db_column_int(&q,4); |
| 273 | 276 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 274 | 277 | if( showAge ){ |
| 275 | 278 | fossil_print("%s %s\n", db_column_text(&q, 5), zPathname); |
| 276 | - }else if( isBrief ){ | |
| 279 | + }else if( !verboseFlag ){ | |
| 277 | 280 | fossil_print("%s\n", zPathname); |
| 278 | 281 | }else if( isNew ){ |
| 279 | 282 | fossil_print("ADDED %s\n", zPathname); |
| 280 | 283 | }else if( isDeleted ){ |
| 281 | 284 | fossil_print("DELETED %s\n", zPathname); |
| 282 | 285 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -219,27 +219,30 @@ | |
| 219 | /* |
| 220 | ** COMMAND: ls |
| 221 | ** |
| 222 | ** Usage: %fossil ls ?OPTIONS? ?VERSION? |
| 223 | ** |
| 224 | ** Show the names of all files in the current checkout. The -l provides |
| 225 | ** extra information about each file. |
| 226 | ** |
| 227 | ** Options: |
| 228 | ** -l Provide extra information about each file. |
| 229 | ** --age Show when each file was committed |
| 230 | ** |
| 231 | ** See also: changes, extra, status |
| 232 | */ |
| 233 | void ls_cmd(void){ |
| 234 | int vid; |
| 235 | Stmt q; |
| 236 | int isBrief; |
| 237 | int showAge; |
| 238 | char *zOrderBy = "pathname"; |
| 239 | |
| 240 | isBrief = find_option("l","l", 0)==0; |
| 241 | showAge = find_option("age",0,0)!=0; |
| 242 | db_must_be_within_tree(); |
| 243 | vid = db_lget_int("checkout", 0); |
| 244 | if( find_option("t","t",0)!=0 ){ |
| 245 | if( showAge ){ |
| @@ -271,11 +274,11 @@ | |
| 271 | int chnged = db_column_int(&q,3); |
| 272 | int renamed = db_column_int(&q,4); |
| 273 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 274 | if( showAge ){ |
| 275 | fossil_print("%s %s\n", db_column_text(&q, 5), zPathname); |
| 276 | }else if( isBrief ){ |
| 277 | fossil_print("%s\n", zPathname); |
| 278 | }else if( isNew ){ |
| 279 | fossil_print("ADDED %s\n", zPathname); |
| 280 | }else if( isDeleted ){ |
| 281 | fossil_print("DELETED %s\n", zPathname); |
| 282 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -219,27 +219,30 @@ | |
| 219 | /* |
| 220 | ** COMMAND: ls |
| 221 | ** |
| 222 | ** Usage: %fossil ls ?OPTIONS? ?VERSION? |
| 223 | ** |
| 224 | ** Show the names of all files in the current checkout. The -v provides |
| 225 | ** extra information about each file. |
| 226 | ** |
| 227 | ** Options: |
| 228 | ** --age Show when each file was committed |
| 229 | ** -v|--verbose Provide extra information about each file. |
| 230 | ** |
| 231 | ** See also: changes, extra, status |
| 232 | */ |
| 233 | void ls_cmd(void){ |
| 234 | int vid; |
| 235 | Stmt q; |
| 236 | int verboseFlag; |
| 237 | int showAge; |
| 238 | char *zOrderBy = "pathname"; |
| 239 | |
| 240 | verboseFlag = find_option("verbose","v", 0)!=0; |
| 241 | if(!verboseFlag){ |
| 242 | verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ |
| 243 | } |
| 244 | showAge = find_option("age",0,0)!=0; |
| 245 | db_must_be_within_tree(); |
| 246 | vid = db_lget_int("checkout", 0); |
| 247 | if( find_option("t","t",0)!=0 ){ |
| 248 | if( showAge ){ |
| @@ -271,11 +274,11 @@ | |
| 274 | int chnged = db_column_int(&q,3); |
| 275 | int renamed = db_column_int(&q,4); |
| 276 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 277 | if( showAge ){ |
| 278 | fossil_print("%s %s\n", db_column_text(&q, 5), zPathname); |
| 279 | }else if( !verboseFlag ){ |
| 280 | fossil_print("%s\n", zPathname); |
| 281 | }else if( isNew ){ |
| 282 | fossil_print("ADDED %s\n", zPathname); |
| 283 | }else if( isDeleted ){ |
| 284 | fossil_print("DELETED %s\n", zPathname); |
| 285 |