Bläddra i källkod

Do not trim if max length is set to 0

Alois Mahdal 9 år sedan
förälder
incheckning
c3f4422a98
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1
    1
      include/sardine.py
  2. 1
    1
      sardine

+ 1
- 1
include/sardine.py Visa fil

@@ -129,7 +129,7 @@ class Subcommand(object):
129 129
         suffix = "…"
130 130
         cooked = raw
131 131
         if self.plugindata.fmt == "plain":
132
-            if len(raw) > self.plugindata.maxlen:
132
+            if self.plugindata.maxlen and len(raw) > self.plugindata.maxlen:
133 133
                 newlen = self.plugindata.maxlen - len(suffix)
134 134
                 cooked = raw[:newlen] + suffix
135 135
         return cooked

+ 1
- 1
sardine Visa fil

@@ -5,7 +5,7 @@
5 5
 usage: sardine [options] COMMAND [ARGS...]
6 6
 
7 7
 Options:
8
-    -c, --chars CHARS specify limit in characters
8
+    -c, --chars CHARS specify limit in characters; zero means no limit
9 9
     --format FMT    specify format: plain is a plain text, xgp
10 10
                     is specific for xfce4-genmon-plugin
11 11
     -p, --plain     same as --format=plain