瀏覽代碼

Do not trim if max length is set to 0

Alois Mahdal 9 年之前
父節點
當前提交
c3f4422a98
共有 2 個檔案被更改,包括 2 行新增2 行删除
  1. 1
    1
      include/sardine.py
  2. 1
    1
      sardine

+ 1
- 1
include/sardine.py 查看文件

@@ -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 查看文件

@@ -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