summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Harris <pharris@opentext.com>2015-02-18 15:41:31 -0500
committerPeter Harris <pharris@opentext.com>2015-02-18 15:41:31 -0500
commit006bd4d0628c30b42ebee4f8fe4f4807028ca329 (patch)
tree834d4fff40df2b2386cd411a074db7364b0b04f6
parentac3f6c587ddc55fcae157a895aa6d3413596fb30 (diff)
Add -stripfont flag
Other common font path strings include "xtsfonts" and "user".
-rw-r--r--config.go6
-rw-r--r--run.go2
2 files changed, 7 insertions, 1 deletions
diff --git a/config.go b/config.go
index 0a6d9f1..6d6d49e 100644
--- a/config.go
+++ b/config.go
@@ -2,6 +2,7 @@ package main
import (
"bufio"
+ "flag"
"fmt"
"io/ioutil"
"log"
@@ -15,6 +16,8 @@ import (
"github.com/BurntSushi/xgb/xproto"
)
+var stripfont = flag.String("stripfont", "xtest", "Remove font directories with this substring")
+
func createConfig(outdir string) error {
// xgb logs when it cannot find Xauthority, which is
// every time when running into a remote Exceed
@@ -129,9 +132,10 @@ func createConfig(outdir string) error {
// xtest fonts on the font path before running xts-config.
set["XT_FONTPATH"] = fontPath
list = list[:0]
+ *stripfont = strings.ToLower(*stripfont)
for _, v := range gfp.Path {
// Remove xtest directory
- if !strings.Contains(strings.ToLower(v.Name), "xtest") {
+ if !strings.Contains(strings.ToLower(v.Name), *stripfont) {
list = append(list, v.Name)
}
}
diff --git a/run.go b/run.go
index 15dd6d5..441929b 100644
--- a/run.go
+++ b/run.go
@@ -10,6 +10,8 @@
// - Adds ability to run a single (or multiple) sub-test(s) (similar to run_assert)
//
// - Avoids shelling out to xts-config (and therefore xset/xdpyinfo) (faster remote startup)
+//
+// - Allows the user to configure the stripped font path for remote servers
package main
import (