From 626d76aeee415ebd4f0fbb4f8740f206de2ec7d3 Mon Sep 17 00:00:00 2001 From: Jose A Ortega Ruiz Date: Fri, 12 Feb 2010 01:38:29 +0100 Subject: New monitor argument to set both max and min widths (-w) Ignore-this: 27650f63b928ee0ae2bf4d4bf19919e5 darcs-hash:20100212003829-748be-c8d9c4bdc4e8b42f6a929f16d1c4aafc65421ec0.gz --- Plugins/Monitors/Common.hs | 24 ++++++++++++++---------- README | 1 + 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index 6729397..2d35a71 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -132,21 +132,23 @@ data Opts = HighColor String | PercentPad String | MinWidth String | MaxWidth String + | Width String | PadChars String | PadAlign String options :: [OptDescr Opts] options = - [ Option ['H'] ["High"] (ReqArg High "number" ) "The high threshold" - , Option ['L'] ["Low"] (ReqArg Low "number" ) "The low threshold" - , Option ['h'] ["high"] (ReqArg HighColor "color number" ) "Color for the high threshold: ex \"#FF0000\"" - , Option ['n'] ["normal"] (ReqArg NormalColor "color number" ) "Color for the normal threshold: ex \"#00FF00\"" - , Option ['l'] ["low"] (ReqArg LowColor "color number" ) "Color for the low threshold: ex \"#0000FF\"" - , Option ['t'] ["template"] (ReqArg Template "output template" ) "Output template." - , Option ['p'] ["ppad"] (ReqArg PercentPad "percent padding" ) "Minimum percentage width." - , Option ['m'] ["minwidth"] (ReqArg MinWidth "minimum width") "Minimum field width" - , Option ['M'] ["maxwidth"] (ReqArg MaxWidth "maximum width") "Maximum field width" - , Option ['c'] ["padchars"] (ReqArg PadChars "padding chars") "Characters to use for padding" + [ Option ['H'] ["High"] (ReqArg High "number" ) "The high threshold" + , Option ['L'] ["Low"] (ReqArg Low "number" ) "The low threshold" + , Option ['h'] ["high"] (ReqArg HighColor "color number" ) "Color for the high threshold: ex \"#FF0000\"" + , Option ['n'] ["normal"] (ReqArg NormalColor "color number" ) "Color for the normal threshold: ex \"#00FF00\"" + , Option ['l'] ["low"] (ReqArg LowColor "color number" ) "Color for the low threshold: ex \"#0000FF\"" + , Option ['t'] ["template"] (ReqArg Template "output template" ) "Output template." + , Option ['p'] ["ppad"] (ReqArg PercentPad "percent padding") "Minimum percentage width." + , Option ['m'] ["minwidth"] (ReqArg MinWidth "minimum width" ) "Minimum field width" + , Option ['M'] ["maxwidth"] (ReqArg MaxWidth "maximum width" ) "Maximum field width" + , Option ['w'] ["width"] (ReqArg Width "fixed width" ) "Fixed field width" + , Option ['c'] ["padchars"] (ReqArg PadChars "padding chars" ) "Characters to use for padding" , Option ['a'] ["align"] (ReqArg PadAlign "padding alignment") "'l' for left padding, 'r' for right" ] @@ -174,6 +176,8 @@ doConfigOptions (o:oo) = PercentPad p -> setConfigValue (nz p) ppad >> next MinWidth mn -> setConfigValue (nz mn) minWidth >> next MaxWidth mx -> setConfigValue (nz mx) maxWidth >> next + Width w -> setConfigValue (nz w) minWidth >> + setConfigValue (nz w) maxWidth >> next PadChars pc -> setConfigValue pc padChars >> next PadAlign pa -> setConfigValue (isPrefixOf "r" pa) padRight >> next diff --git a/README b/README index 43a7549..27fdcfb 100644 --- a/README +++ b/README @@ -465,6 +465,7 @@ These are the arguments that can be used for internal commands in the -p number --ppad=number Pad percentages to given width -m number --minwidth=number Minimum field width -M number --maxwidth=number Maximum field width + -w number --width=number Fixed field width -c chars --padchars=chars Chars used (cyclically) for padding -a ["r" or "l"] --align=["r" or "l"] Pad alignment (right/left) -t output template --template=output template Output template of the command. -- cgit v1.2.3