Skip to content

Commit d481e2c

Browse files
committed
csearch: add -html flag
Experimental and not very useful yet.
1 parent 8aad6cc commit d481e2c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cmd/csearch/csearch.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func usage() {
5151
var (
5252
fFlag = flag.String("f", "", "search only files with names matching this regexp")
5353
iFlag = flag.Bool("i", false, "case-insensitive search")
54+
htmlFlag = flag.Bool("html", false, "print HTML output")
5455
verboseFlag = flag.Bool("verbose", false, "print extra information")
5556
bruteFlag = flag.Bool("brute", false, "brute force - search all files in index")
5657
cpuProfile = flag.String("cpuprofile", "", "write cpu profile to this file")
@@ -68,6 +69,9 @@ func Main() {
6869

6970
flag.Usage = usage
7071
flag.Parse()
72+
if *htmlFlag {
73+
g.HTML = true
74+
}
7175
args := flag.Args()
7276

7377
if len(args) != 1 {
@@ -148,7 +152,7 @@ func Main() {
148152
}
149153
file, err := os.Open(string(name))
150154
if err != nil {
151-
if i := strings.Index(name, ".zip#"); i >= 0 {
155+
if i := strings.Index(name, ".zip\x01"); i >= 0 {
152156
zfile, zname := name[:i+4], name[i+5:]
153157
if zfile != zipFile {
154158
if zipReader != nil {

0 commit comments

Comments
 (0)