Fossil SCM

Add option -v|--verbose to "fossil ls" as replacement for (deprecated) -l.

jan.nijtmans 2013-05-21 13:56 trunk
Commit e91d65afe5a7441f7542ed67f3693ff6f231b6dd
1 file changed +8 -5
+8 -5
--- src/checkin.c
+++ src/checkin.c
@@ -219,27 +219,30 @@
219219
/*
220220
** COMMAND: ls
221221
**
222222
** Usage: %fossil ls ?OPTIONS? ?VERSION?
223223
**
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
225225
** extra information about each file.
226226
**
227227
** Options:
228
-** -l Provide extra information about each file.
229228
** --age Show when each file was committed
229
+** -v|--verbose Provide extra information about each file.
230230
**
231231
** See also: changes, extra, status
232232
*/
233233
void ls_cmd(void){
234234
int vid;
235235
Stmt q;
236
- int isBrief;
236
+ int verboseFlag;
237237
int showAge;
238238
char *zOrderBy = "pathname";
239239
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
+ }
241244
showAge = find_option("age",0,0)!=0;
242245
db_must_be_within_tree();
243246
vid = db_lget_int("checkout", 0);
244247
if( find_option("t","t",0)!=0 ){
245248
if( showAge ){
@@ -271,11 +274,11 @@
271274
int chnged = db_column_int(&q,3);
272275
int renamed = db_column_int(&q,4);
273276
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
274277
if( showAge ){
275278
fossil_print("%s %s\n", db_column_text(&q, 5), zPathname);
276
- }else if( isBrief ){
279
+ }else if( !verboseFlag ){
277280
fossil_print("%s\n", zPathname);
278281
}else if( isNew ){
279282
fossil_print("ADDED %s\n", zPathname);
280283
}else if( isDeleted ){
281284
fossil_print("DELETED %s\n", zPathname);
282285
--- 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

Keyboard Shortcuts

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