Compare commits

..

No commits in common. "8cf41b0614995cc5ac6939e9714f4f8279427ce1" and "4b430213d54dce524509c3e2bf3954bffdf4cea1" have entirely different histories.

2 changed files with 7 additions and 24 deletions

View File

@ -1,17 +1,11 @@
all:
go build .
run:
go run . test_files/test.md
go run main.go tree.go test_files/test.md
test:
go run . test_files/test.md
go run . test_files/README.md
go run . test_files/weird_headers.md
go run . test_files/audio.md
install:
cp -v mdtoc /usr/local/bin/.
go run main.go tree.go test_files/test.md
go run main.go tree.go test_files/README.md
go run main.go tree.go test_files/weird_headers.md
go run main.go tree.go test_files/audio.md
clean:
go clean
rm -vf main

13
main.go
View File

@ -61,19 +61,8 @@ func parse_file(file_name string) []heading {
return headings
}
func usage() {
fmt.Printf("Usage: mdtoc [FILE]\n")
os.Exit(1)
}
func main() {
var file_name string = ""
if len(os.Args) == 2 {
file_name = os.Args[1]
} else {
usage()
}
file_name := os.Args[1]
var headings []heading = nil