Overview
SHA1 Hash: | 9c06ea312083459c5f73298a0eb457d8f8ee3d00 |
---|---|
Date: | 2009-12-17 14:27:06 |
User: | drh |
Comment: | Change the "ls" command so that it only shows the filenames by default. To see the extra information about the status of each file, add the -l option. Ex: "fossil ls -l" |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/checkin.c from [c1819242e8] to [ef3cc1bd3e].
@@ -121,18 +121,21 @@ } /* ** COMMAND: ls ** -** Usage: %fossil ls -** -** Show the names of all files in the current checkout +** Usage: %fossil ls [-l] +** +** Show the names of all files in the current checkout. The -l provides +** extra information about each file. */ void ls_cmd(void){ int vid; Stmt q; - + int isBrief; + + isBrief = find_option("l","l", 0)==0; db_must_be_within_tree(); vid = db_lget_int("checkout", 0); vfile_check_signature(vid); db_prepare(&q, "SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)" @@ -144,11 +147,13 @@ int isDeleted = db_column_int(&q, 1); int isNew = db_column_int(&q,2)==0; int chnged = db_column_int(&q,3); int renamed = db_column_int(&q,4); char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname); - if( isNew ){ + if( isBrief ){ + printf("%s\n", zPathname); + }else if( isNew ){ printf("ADDED %s\n", zPathname); }else if( access(zFullName, 0) ){ printf("MISSING %s\n", zPathname); }else if( isDeleted ){ printf("DELETED %s\n", zPathname);