mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-08-30 05:46:28 -04:00
- Support df command
- Return warnings array from ParseSyntaxFiles() in addition to potential error. Not being able to parse the dir is a fatal error but if a random file cannot be read, it should be considered a warning.
This commit is contained in:
+4
-1
@@ -28,11 +28,14 @@ func main() {
|
||||
}
|
||||
|
||||
var defs []*highlight.Def
|
||||
err := highlight.ParseSyntaxFiles(syn_dir, &defs)
|
||||
err, warnings := highlight.ParseSyntaxFiles(syn_dir, &defs)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// it's up to you what to do with the warnings. You can print them or ignore them
|
||||
fmt.Println(warnings)
|
||||
|
||||
highlight.ResolveIncludes(defs)
|
||||
|
||||
fileSrc, _ := ioutil.ReadFile(os.Args[1])
|
||||
|
||||
Reference in New Issue
Block a user