summaryrefslogtreecommitdiff
path: root/dict.go
diff options
context:
space:
mode:
Diffstat (limited to 'dict.go')
-rw-r--r--dict.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/dict.go b/dict.go
index e1b05a1..74bce24 100644
--- a/dict.go
+++ b/dict.go
@@ -56,12 +56,25 @@ func main() {
return
}
- for i, _ := range left {
+ ml := 5
+
+ for _, v := range right {
+ if len(v) > ml {
+ ml = len(v)
+ }
+ }
+
+ if ml > 40 {
+ ml = 40
+ }
+
+ for i, _ := range right {
a := strings.Trim(right[i], `"`)
b := strings.Trim(left[i], `"`)
if a == "" {
continue
}
- fmt.Printf("%25s → %s\n", a, b)
+ // TODO: wrap when len(a) > ml
+ fmt.Printf("%*s → %s\n", ml, a, b)
}
}