Fossil SCM

Add options for drawing the file tree with Unicode symbols or ASCII characters (Windows defaults to the latter, all others to the former).

danield 2024-04-29 15:25 trunk
Commit 635fa090d10a20436e281e040c3a50f6a98ef9c4b474e1db6c4e8b3eb6064b70
1 file changed +61 -17
+61 -17
--- src/checkin.c
+++ src/checkin.c
@@ -646,25 +646,40 @@
646646
*/
647647
static const char *print_filelist_section(
648648
const char *zIn, /* List of filenames, separated by \n */
649649
const char *zLast, /* Last filename in the list to print */
650650
const char *zPrefix, /* Prefix so put before each output line */
651
- int nDir /* Ignore this many characters of directory name */
651
+ int nDir, /* Ignore this many characters of directory name */
652
+ int treeFmt /* 1 = use Unicode symbols, 2 = use ASCII chars */
652653
){
654
+ const char *treeEntry = "|-- ";
655
+ const char *treeLastE = "`-- ";
656
+ const char *treeContu = "| ";
657
+ const char *treeBlank = " ";
658
+ if( treeFmt == 1 ){
659
+ treeEntry = "\342\224\234\342\224\200\342\224\200 ";
660
+ treeLastE = "\342\224\224\342\224\200\342\224\200 ";
661
+ treeContu = "\342\224\202 ";
662
+ }
653663
while( zIn<=zLast ){
654664
int i;
665
+ // const char *treeContu = (treeFmt == 1) ? "\342\224\202 " : "| ";
666
+ // const char *treeEntry = (treeFmt == 1) ? "\342\224\234\342\224\200\342\224\200 " : "|-- ";
667
+ // const char *treeLastE = (treeFmt == 1) ? "\342\224\224\342\224\200\342\224\200 " : "`-- ";
668
+ // const char *treeBlank = " ";
655669
for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
656670
if( zIn[i]=='/' ){
657671
char *zSubPrefix;
658672
const char *zSubLast = last_line(zIn, i+1);
659
- zSubPrefix = mprintf("%s%s", zPrefix, zSubLast==zLast ? BLANK : CONTU);
660
- fossil_print("%s%s%.*s\n", zPrefix, zSubLast==zLast ? LASTE : ENTRY,
661
- i-nDir, &zIn[nDir]);
662
- zIn = print_filelist_section(zIn, zSubLast, zSubPrefix, i+1);
673
+ zSubPrefix = mprintf("%s%s", zPrefix,
674
+ zSubLast==zLast ? treeBlank : treeContu);
675
+ fossil_print("%s%s%.*s\n", zPrefix,
676
+ zSubLast==zLast ? treeLastE : treeEntry, i-nDir, &zIn[nDir]);
677
+ zIn = print_filelist_section(zIn, zSubLast, zSubPrefix, i+1, treeFmt);
663678
fossil_free(zSubPrefix);
664679
}else{
665
- fossil_print("%s%s%.*s\n", zPrefix, zIn==zLast ? LASTE : ENTRY,
680
+ fossil_print("%s%s%.*s\n", zPrefix, zIn==zLast ? treeLastE : treeEntry,
666681
i-nDir, &zIn[nDir]);
667682
zIn = next_line(zIn);
668683
}
669684
}
670685
return zIn;
@@ -673,18 +688,18 @@
673688
/*
674689
** Input blob pList is a list of filenames, one filename per line,
675690
** in sorted order and with / directory separators. Output this list
676691
** as a tree in a manner similar to the "tree" command on Linux.
677692
*/
678
-static void print_filelist_as_tree(Blob *pList){
693
+static void print_filelist_as_tree(Blob *pList, int treeFmt){
679694
char *zAll;
680695
const char *zLast;
681696
fossil_print("%s\n", g.zLocalRoot);
682697
zAll = blob_str(pList);
683698
if( zAll[0] ){
684699
zLast = last_line(zAll, 0);
685
- print_filelist_section(zAll, zLast, "", 0);
700
+ print_filelist_section(zAll, zLast, "", 0, treeFmt);
686701
}
687702
}
688703
689704
/*
690705
** Take care of -r version of ls command
@@ -760,11 +775,11 @@
760775
fossil_print("%s\n", zFile);
761776
}
762777
}
763778
db_finalize(&q);
764779
if( treeFmt ){
765
- print_filelist_as_tree(&out);
780
+ print_filelist_as_tree(&out, treeFmt);
766781
blob_reset(&out);
767782
}
768783
}
769784
770785
/*
@@ -792,26 +807,30 @@
792807
** path and name (case insensitive sort if -r). If neither --age nor -r
793808
** are used, -t sorts by modification time, otherwise by commit time.
794809
**
795810
** Options:
796811
** --age Show when each file was committed
797
-** -v|--verbose Provide extra information about each file
798
-** -t Sort output in time order
799
-** --tree Tree format
812
+** -a|--ascii-tree Use ASCII characters when drawing the tree
813
+** --hash With -v, verify file status using hashing
814
+** rather than relying on file sizes and mtimes
800815
** -r VERSION The specific check-in to list
801816
** -R|--repository REPO Extract info from repository REPO
802
-** --hash With -v, verify file status using hashing
803
-** rather than relying on file sizes and mtimes
817
+** -t Sort output in time order
818
+** --tree Tree format
819
+** -u|--unicode-tree Use Unicode symbols when drawing the tree
820
+** -v|--verbose Provide extra information about each file
804821
**
805822
** See also: [[changes]], [[extras]], [[status]], [[tree]]
806823
*/
807824
void ls_cmd(void){
808825
int vid;
809826
Stmt q;
810827
int verboseFlag;
811828
int showAge;
812829
int treeFmt;
830
+ int asciiTree;
831
+ int unicodeTree;
813832
int timeOrder;
814833
char *zOrderBy = "pathname";
815834
Blob where;
816835
int i;
817836
int useHash = 0;
@@ -827,12 +846,19 @@
827846
timeOrder = find_option("t","t",0)!=0;
828847
if( verboseFlag ){
829848
useHash = find_option("hash",0,0)!=0;
830849
}
831850
treeFmt = find_option("tree",0,0)!=0;
851
+ asciiTree = find_option("ascii-tree","a",0)!=0;
852
+ unicodeTree = find_option("unicode-tree","u",0)!=0;
832853
if( treeFmt ){
833854
if( zRev==0 ) zRev = "current";
855
+#ifdef _WIN32
856
+ treeFmt = 2;
857
+#endif
858
+ if( unicodeTree ) treeFmt = 1;
859
+ if( asciiTree ) treeFmt = 2;
834860
}
835861
836862
if( zRev!=0 ){
837863
db_find_and_open_repository(0, 0);
838864
verify_all_options();
@@ -945,23 +971,32 @@
945971
** List all files in the current check-out in after the fashion of the
946972
** "tree" command. If PATHS is included, only the named files
947973
** (or their children if directories) are shown.
948974
**
949975
** Options:
976
+** -a|--ascii-tree Use ASCII characters when drawing the tree
950977
** -r VERSION The specific check-in to list
951978
** -R|--repository REPO Extract info from repository REPO
979
+** -u|--unicode-tree Use Unicode symbols when drawing the tree
952980
**
953981
** See also: [[ls]]
954982
*/
955983
void tree_cmd(void){
956984
const char *zRev;
957
-
985
+ int treeFmt = 1;
986
+ int asciiTree = find_option("ascii-tree","a",0)!=0;
987
+ int unicodeTree = find_option("unicode-tree","u",0)!=0;
988
+#ifdef _WIN32
989
+ treeFmt = 2;
990
+#endif
991
+ if( unicodeTree ) treeFmt = 1;
992
+ if( asciiTree ) treeFmt = 2;
958993
zRev = find_option("r","r",1);
959994
if( zRev==0 ) zRev = "current";
960995
db_find_and_open_repository(0, 0);
961996
verify_all_options();
962
- ls_cmd_rev(zRev,0,0,0,1);
997
+ ls_cmd_rev(zRev, 0, 0, 0, treeFmt);
963998
}
964999
9651000
/*
9661001
** COMMAND: extras
9671002
**
@@ -981,17 +1016,19 @@
9811016
** Pathnames are displayed according to the "relative-paths" setting,
9821017
** unless overridden by the --abs-paths or --rel-paths options.
9831018
**
9841019
** Options:
9851020
** --abs-paths Display absolute pathnames
1021
+** -a|--ascii-tree Use ASCII characters when drawing the tree
9861022
** --case-sensitive BOOL Override case-sensitive setting
9871023
** --dotfiles Include files beginning with a dot (".")
9881024
** --header Identify the repository if there are extras
9891025
** --ignore CSG Ignore files matching patterns from the argument
9901026
** --rel-paths Display pathnames relative to the current working
9911027
** directory
9921028
** --tree Show output in the tree format
1029
+** -u|--unicode-tree Use Unicode symbols when drawing the tree
9931030
**
9941031
** See also: [[changes]], [[clean]], [[status]]
9951032
*/
9961033
void extras_cmd(void){
9971034
Blob report = BLOB_INITIALIZER;
@@ -998,10 +1035,12 @@
9981035
const char *zIgnoreFlag = find_option("ignore",0,1);
9991036
unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
10001037
unsigned flags = C_EXTRA;
10011038
int showHdr = find_option("header",0,0)!=0;
10021039
int treeFmt = find_option("tree",0,0)!=0;
1040
+ int asciiTree = find_option("ascii-tree","a",0)!=0;
1041
+ int unicodeTree = find_option("unicode-tree","u",0)!=0;
10031042
Glob *pIgnore;
10041043
10051044
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
10061045
db_must_be_within_tree();
10071046
@@ -1011,10 +1050,15 @@
10111050
10121051
if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
10131052
10141053
if( treeFmt ){
10151054
flags &= ~C_RELPATH;
1055
+#ifdef _WIN32
1056
+ treeFmt = 2;
1057
+#endif
1058
+ if( unicodeTree ) treeFmt = 1;
1059
+ if( asciiTree ) treeFmt = 2;
10161060
}
10171061
10181062
/* We should be done with options.. */
10191063
verify_all_options();
10201064
@@ -1031,11 +1075,11 @@
10311075
if( showHdr ){
10321076
fossil_print("Extras for %s at %s:\n", db_get("project-name","<unnamed>"),
10331077
g.zLocalRoot);
10341078
}
10351079
if( treeFmt ){
1036
- print_filelist_as_tree(&report);
1080
+ print_filelist_as_tree(&report, treeFmt);
10371081
}else{
10381082
blob_write_to_file(&report, "-");
10391083
}
10401084
}
10411085
blob_reset(&report);
10421086
--- src/checkin.c
+++ src/checkin.c
@@ -646,25 +646,40 @@
646 */
647 static const char *print_filelist_section(
648 const char *zIn, /* List of filenames, separated by \n */
649 const char *zLast, /* Last filename in the list to print */
650 const char *zPrefix, /* Prefix so put before each output line */
651 int nDir /* Ignore this many characters of directory name */
 
652 ){
 
 
 
 
 
 
 
 
 
653 while( zIn<=zLast ){
654 int i;
 
 
 
 
655 for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
656 if( zIn[i]=='/' ){
657 char *zSubPrefix;
658 const char *zSubLast = last_line(zIn, i+1);
659 zSubPrefix = mprintf("%s%s", zPrefix, zSubLast==zLast ? BLANK : CONTU);
660 fossil_print("%s%s%.*s\n", zPrefix, zSubLast==zLast ? LASTE : ENTRY,
661 i-nDir, &zIn[nDir]);
662 zIn = print_filelist_section(zIn, zSubLast, zSubPrefix, i+1);
 
663 fossil_free(zSubPrefix);
664 }else{
665 fossil_print("%s%s%.*s\n", zPrefix, zIn==zLast ? LASTE : ENTRY,
666 i-nDir, &zIn[nDir]);
667 zIn = next_line(zIn);
668 }
669 }
670 return zIn;
@@ -673,18 +688,18 @@
673 /*
674 ** Input blob pList is a list of filenames, one filename per line,
675 ** in sorted order and with / directory separators. Output this list
676 ** as a tree in a manner similar to the "tree" command on Linux.
677 */
678 static void print_filelist_as_tree(Blob *pList){
679 char *zAll;
680 const char *zLast;
681 fossil_print("%s\n", g.zLocalRoot);
682 zAll = blob_str(pList);
683 if( zAll[0] ){
684 zLast = last_line(zAll, 0);
685 print_filelist_section(zAll, zLast, "", 0);
686 }
687 }
688
689 /*
690 ** Take care of -r version of ls command
@@ -760,11 +775,11 @@
760 fossil_print("%s\n", zFile);
761 }
762 }
763 db_finalize(&q);
764 if( treeFmt ){
765 print_filelist_as_tree(&out);
766 blob_reset(&out);
767 }
768 }
769
770 /*
@@ -792,26 +807,30 @@
792 ** path and name (case insensitive sort if -r). If neither --age nor -r
793 ** are used, -t sorts by modification time, otherwise by commit time.
794 **
795 ** Options:
796 ** --age Show when each file was committed
797 ** -v|--verbose Provide extra information about each file
798 ** -t Sort output in time order
799 ** --tree Tree format
800 ** -r VERSION The specific check-in to list
801 ** -R|--repository REPO Extract info from repository REPO
802 ** --hash With -v, verify file status using hashing
803 ** rather than relying on file sizes and mtimes
 
 
804 **
805 ** See also: [[changes]], [[extras]], [[status]], [[tree]]
806 */
807 void ls_cmd(void){
808 int vid;
809 Stmt q;
810 int verboseFlag;
811 int showAge;
812 int treeFmt;
 
 
813 int timeOrder;
814 char *zOrderBy = "pathname";
815 Blob where;
816 int i;
817 int useHash = 0;
@@ -827,12 +846,19 @@
827 timeOrder = find_option("t","t",0)!=0;
828 if( verboseFlag ){
829 useHash = find_option("hash",0,0)!=0;
830 }
831 treeFmt = find_option("tree",0,0)!=0;
 
 
832 if( treeFmt ){
833 if( zRev==0 ) zRev = "current";
 
 
 
 
 
834 }
835
836 if( zRev!=0 ){
837 db_find_and_open_repository(0, 0);
838 verify_all_options();
@@ -945,23 +971,32 @@
945 ** List all files in the current check-out in after the fashion of the
946 ** "tree" command. If PATHS is included, only the named files
947 ** (or their children if directories) are shown.
948 **
949 ** Options:
 
950 ** -r VERSION The specific check-in to list
951 ** -R|--repository REPO Extract info from repository REPO
 
952 **
953 ** See also: [[ls]]
954 */
955 void tree_cmd(void){
956 const char *zRev;
957
 
 
 
 
 
 
 
958 zRev = find_option("r","r",1);
959 if( zRev==0 ) zRev = "current";
960 db_find_and_open_repository(0, 0);
961 verify_all_options();
962 ls_cmd_rev(zRev,0,0,0,1);
963 }
964
965 /*
966 ** COMMAND: extras
967 **
@@ -981,17 +1016,19 @@
981 ** Pathnames are displayed according to the "relative-paths" setting,
982 ** unless overridden by the --abs-paths or --rel-paths options.
983 **
984 ** Options:
985 ** --abs-paths Display absolute pathnames
 
986 ** --case-sensitive BOOL Override case-sensitive setting
987 ** --dotfiles Include files beginning with a dot (".")
988 ** --header Identify the repository if there are extras
989 ** --ignore CSG Ignore files matching patterns from the argument
990 ** --rel-paths Display pathnames relative to the current working
991 ** directory
992 ** --tree Show output in the tree format
 
993 **
994 ** See also: [[changes]], [[clean]], [[status]]
995 */
996 void extras_cmd(void){
997 Blob report = BLOB_INITIALIZER;
@@ -998,10 +1035,12 @@
998 const char *zIgnoreFlag = find_option("ignore",0,1);
999 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
1000 unsigned flags = C_EXTRA;
1001 int showHdr = find_option("header",0,0)!=0;
1002 int treeFmt = find_option("tree",0,0)!=0;
 
 
1003 Glob *pIgnore;
1004
1005 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
1006 db_must_be_within_tree();
1007
@@ -1011,10 +1050,15 @@
1011
1012 if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
1013
1014 if( treeFmt ){
1015 flags &= ~C_RELPATH;
 
 
 
 
 
1016 }
1017
1018 /* We should be done with options.. */
1019 verify_all_options();
1020
@@ -1031,11 +1075,11 @@
1031 if( showHdr ){
1032 fossil_print("Extras for %s at %s:\n", db_get("project-name","<unnamed>"),
1033 g.zLocalRoot);
1034 }
1035 if( treeFmt ){
1036 print_filelist_as_tree(&report);
1037 }else{
1038 blob_write_to_file(&report, "-");
1039 }
1040 }
1041 blob_reset(&report);
1042
--- src/checkin.c
+++ src/checkin.c
@@ -646,25 +646,40 @@
646 */
647 static const char *print_filelist_section(
648 const char *zIn, /* List of filenames, separated by \n */
649 const char *zLast, /* Last filename in the list to print */
650 const char *zPrefix, /* Prefix so put before each output line */
651 int nDir, /* Ignore this many characters of directory name */
652 int treeFmt /* 1 = use Unicode symbols, 2 = use ASCII chars */
653 ){
654 const char *treeEntry = "|-- ";
655 const char *treeLastE = "`-- ";
656 const char *treeContu = "| ";
657 const char *treeBlank = " ";
658 if( treeFmt == 1 ){
659 treeEntry = "\342\224\234\342\224\200\342\224\200 ";
660 treeLastE = "\342\224\224\342\224\200\342\224\200 ";
661 treeContu = "\342\224\202 ";
662 }
663 while( zIn<=zLast ){
664 int i;
665 // const char *treeContu = (treeFmt == 1) ? "\342\224\202 " : "| ";
666 // const char *treeEntry = (treeFmt == 1) ? "\342\224\234\342\224\200\342\224\200 " : "|-- ";
667 // const char *treeLastE = (treeFmt == 1) ? "\342\224\224\342\224\200\342\224\200 " : "`-- ";
668 // const char *treeBlank = " ";
669 for(i=nDir; zIn[i]!='\n' && zIn[i]!='/'; i++){}
670 if( zIn[i]=='/' ){
671 char *zSubPrefix;
672 const char *zSubLast = last_line(zIn, i+1);
673 zSubPrefix = mprintf("%s%s", zPrefix,
674 zSubLast==zLast ? treeBlank : treeContu);
675 fossil_print("%s%s%.*s\n", zPrefix,
676 zSubLast==zLast ? treeLastE : treeEntry, i-nDir, &zIn[nDir]);
677 zIn = print_filelist_section(zIn, zSubLast, zSubPrefix, i+1, treeFmt);
678 fossil_free(zSubPrefix);
679 }else{
680 fossil_print("%s%s%.*s\n", zPrefix, zIn==zLast ? treeLastE : treeEntry,
681 i-nDir, &zIn[nDir]);
682 zIn = next_line(zIn);
683 }
684 }
685 return zIn;
@@ -673,18 +688,18 @@
688 /*
689 ** Input blob pList is a list of filenames, one filename per line,
690 ** in sorted order and with / directory separators. Output this list
691 ** as a tree in a manner similar to the "tree" command on Linux.
692 */
693 static void print_filelist_as_tree(Blob *pList, int treeFmt){
694 char *zAll;
695 const char *zLast;
696 fossil_print("%s\n", g.zLocalRoot);
697 zAll = blob_str(pList);
698 if( zAll[0] ){
699 zLast = last_line(zAll, 0);
700 print_filelist_section(zAll, zLast, "", 0, treeFmt);
701 }
702 }
703
704 /*
705 ** Take care of -r version of ls command
@@ -760,11 +775,11 @@
775 fossil_print("%s\n", zFile);
776 }
777 }
778 db_finalize(&q);
779 if( treeFmt ){
780 print_filelist_as_tree(&out, treeFmt);
781 blob_reset(&out);
782 }
783 }
784
785 /*
@@ -792,26 +807,30 @@
807 ** path and name (case insensitive sort if -r). If neither --age nor -r
808 ** are used, -t sorts by modification time, otherwise by commit time.
809 **
810 ** Options:
811 ** --age Show when each file was committed
812 ** -a|--ascii-tree Use ASCII characters when drawing the tree
813 ** --hash With -v, verify file status using hashing
814 ** rather than relying on file sizes and mtimes
815 ** -r VERSION The specific check-in to list
816 ** -R|--repository REPO Extract info from repository REPO
817 ** -t Sort output in time order
818 ** --tree Tree format
819 ** -u|--unicode-tree Use Unicode symbols when drawing the tree
820 ** -v|--verbose Provide extra information about each file
821 **
822 ** See also: [[changes]], [[extras]], [[status]], [[tree]]
823 */
824 void ls_cmd(void){
825 int vid;
826 Stmt q;
827 int verboseFlag;
828 int showAge;
829 int treeFmt;
830 int asciiTree;
831 int unicodeTree;
832 int timeOrder;
833 char *zOrderBy = "pathname";
834 Blob where;
835 int i;
836 int useHash = 0;
@@ -827,12 +846,19 @@
846 timeOrder = find_option("t","t",0)!=0;
847 if( verboseFlag ){
848 useHash = find_option("hash",0,0)!=0;
849 }
850 treeFmt = find_option("tree",0,0)!=0;
851 asciiTree = find_option("ascii-tree","a",0)!=0;
852 unicodeTree = find_option("unicode-tree","u",0)!=0;
853 if( treeFmt ){
854 if( zRev==0 ) zRev = "current";
855 #ifdef _WIN32
856 treeFmt = 2;
857 #endif
858 if( unicodeTree ) treeFmt = 1;
859 if( asciiTree ) treeFmt = 2;
860 }
861
862 if( zRev!=0 ){
863 db_find_and_open_repository(0, 0);
864 verify_all_options();
@@ -945,23 +971,32 @@
971 ** List all files in the current check-out in after the fashion of the
972 ** "tree" command. If PATHS is included, only the named files
973 ** (or their children if directories) are shown.
974 **
975 ** Options:
976 ** -a|--ascii-tree Use ASCII characters when drawing the tree
977 ** -r VERSION The specific check-in to list
978 ** -R|--repository REPO Extract info from repository REPO
979 ** -u|--unicode-tree Use Unicode symbols when drawing the tree
980 **
981 ** See also: [[ls]]
982 */
983 void tree_cmd(void){
984 const char *zRev;
985 int treeFmt = 1;
986 int asciiTree = find_option("ascii-tree","a",0)!=0;
987 int unicodeTree = find_option("unicode-tree","u",0)!=0;
988 #ifdef _WIN32
989 treeFmt = 2;
990 #endif
991 if( unicodeTree ) treeFmt = 1;
992 if( asciiTree ) treeFmt = 2;
993 zRev = find_option("r","r",1);
994 if( zRev==0 ) zRev = "current";
995 db_find_and_open_repository(0, 0);
996 verify_all_options();
997 ls_cmd_rev(zRev, 0, 0, 0, treeFmt);
998 }
999
1000 /*
1001 ** COMMAND: extras
1002 **
@@ -981,17 +1016,19 @@
1016 ** Pathnames are displayed according to the "relative-paths" setting,
1017 ** unless overridden by the --abs-paths or --rel-paths options.
1018 **
1019 ** Options:
1020 ** --abs-paths Display absolute pathnames
1021 ** -a|--ascii-tree Use ASCII characters when drawing the tree
1022 ** --case-sensitive BOOL Override case-sensitive setting
1023 ** --dotfiles Include files beginning with a dot (".")
1024 ** --header Identify the repository if there are extras
1025 ** --ignore CSG Ignore files matching patterns from the argument
1026 ** --rel-paths Display pathnames relative to the current working
1027 ** directory
1028 ** --tree Show output in the tree format
1029 ** -u|--unicode-tree Use Unicode symbols when drawing the tree
1030 **
1031 ** See also: [[changes]], [[clean]], [[status]]
1032 */
1033 void extras_cmd(void){
1034 Blob report = BLOB_INITIALIZER;
@@ -998,10 +1035,12 @@
1035 const char *zIgnoreFlag = find_option("ignore",0,1);
1036 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
1037 unsigned flags = C_EXTRA;
1038 int showHdr = find_option("header",0,0)!=0;
1039 int treeFmt = find_option("tree",0,0)!=0;
1040 int asciiTree = find_option("ascii-tree","a",0)!=0;
1041 int unicodeTree = find_option("unicode-tree","u",0)!=0;
1042 Glob *pIgnore;
1043
1044 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
1045 db_must_be_within_tree();
1046
@@ -1011,10 +1050,15 @@
1050
1051 if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL;
1052
1053 if( treeFmt ){
1054 flags &= ~C_RELPATH;
1055 #ifdef _WIN32
1056 treeFmt = 2;
1057 #endif
1058 if( unicodeTree ) treeFmt = 1;
1059 if( asciiTree ) treeFmt = 2;
1060 }
1061
1062 /* We should be done with options.. */
1063 verify_all_options();
1064
@@ -1031,11 +1075,11 @@
1075 if( showHdr ){
1076 fossil_print("Extras for %s at %s:\n", db_get("project-name","<unnamed>"),
1077 g.zLocalRoot);
1078 }
1079 if( treeFmt ){
1080 print_filelist_as_tree(&report, treeFmt);
1081 }else{
1082 blob_write_to_file(&report, "-");
1083 }
1084 }
1085 blob_reset(&report);
1086

Keyboard Shortcuts

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