Improve docs and parsing of graph args further.
authorBrenden Matthews <brenden@rty.ca>
Sun, 5 Jul 2009 04:03:12 +0000 (22:03 -0600)
committerBrenden Matthews <brenden@rty.ca>
Sun, 5 Jul 2009 04:03:12 +0000 (22:03 -0600)
doc/variables.xml
src/specials.c

index 47e7924..1f8d2e0 100644 (file)
         default_graph_size config setting. Takes the switch '-t' to
         use a temperature gradient, which makes the gradient values
         change depending on the amplitude of a particular graph
-        value (try it and see). 
+        value (try it and see).  If -t or -l is your first argument, you may need to preceed it by a space (' ').
         <para /></listitem>
     </varlistentry>
     <varlistentry>
             <option>interval (-t) (-l) command</option>
         </term>
         <listitem>Same as execgraph, but takes an interval arg and
-        graphs values. 
+        graphs values.  If -t or -l is your first argument, you may need to preceed it by a space (' ').
         <para /></listitem>
     </varlistentry>
     <varlistentry>
             <command>
                 <option>loadavg</option>
             </command>
+                       <option>(1|2|3)
+                       </option>
         </term>
-        <listitem>(1,2,3)&gt; System load average, 1 is for past 1
+        <listitem>System load average, 1 is for past 1
         minute, 2 for past 5 minutes and 3 for past 15 minutes. 
         <para /></listitem>
     </varlistentry>
             <command>
                 <option>loadgraph</option>
             </command>
-            <option>(height),(width) (gradient colour 1) (gradient
+            <option>(1|2|3) (height),(width) (gradient colour 1) (gradient
             colour 2) (scale) (-t) (-l)</option>
         </term>
         <listitem>Load1 average graph, similar to xload, with
index f5af204..f8007d7 100644 (file)
@@ -119,14 +119,12 @@ char *scan_graph(const char *args, int *w, int *h,
        *tempgrad = FALSE;
        *showaslog = FALSE;
        if (args) {
-               if (strstr(args, " "TEMPGRAD)) {
+               if (strstr(args, " "TEMPGRAD) || strncmp(args, TEMPGRAD, strlen(TEMPGRAD)) == 0) {
                        *tempgrad = TRUE;
                }
-               if (strstr(args, " "LOGGRAPH)) {
+               if (strstr(args, " "LOGGRAPH) || strncmp(args, LOGGRAPH, strlen(LOGGRAPH)) == 0) {
                        *showaslog = TRUE;
                }
-               DBGP("printing graph as %s, other args are: %s", (*showaslog ? "log" : "normal"), args);
-               //check the rest of the args
                if (sscanf(args, "%d,%d %x %x %u", h, w, first_colour, last_colour, scale) == 5) {
                        return NULL;
                }