Print this page
3623 kstat must accept partial stat specification

@@ -31,11 +31,10 @@
  * This is a reimplementation of the perl kstat command originally found
  * under usr/src/cmd/kstat/kstat.pl
  *
  * Incompatibilities:
  *      - perl regular expressions replaced with extended REs bracketed by '/'
- *      - options checking is stricter
  *
  * Flags added:
  *      -C      similar to the -p option but value is separated by a colon
  *      -h      display help
  *      -j      json format

@@ -253,16 +252,10 @@
                                                 assert(B_FALSE);
                                         }
                                 }
                         }
 
-                        if (m < 4) {
-                                free(uselector);
-                                usage();
-                                exit(2);
-                        }
-
                         uselflg = B_TRUE;
                         list_insert_tail(&selector_list, uselector);
                 } else {
                         if (tmp < 1) {
                                 if (n == 0) {

@@ -295,11 +288,11 @@
          * Check if we founded a named selector on the cmdline.
          */
         if (uselflg) {
                 if (nselflg) {
                         (void) fprintf(stderr, gettext(
-                            "module:instance:name:statistic and "
+                            "[module[:instance[:name[:statistic]]]] and "
                             "-m -i -n -s are mutually exclusive"));
                         usage();
                         exit(2);
                 } else {
                         free(nselector);

@@ -360,11 +353,11 @@
             "Usage:\n"
             "kstat [ -Cjlpq ] [ -T d|u ] [ -c class ]\n"
             "      [ -m module ] [ -i instance ] [ -n name ] [ -s statistic ]\n"
             "      [ interval [ count ] ]\n"
             "kstat [ -Cjlpq ] [ -T d|u ] [ -c class ]\n"
-            "      [ module:instance:name:statistic ... ]\n"
+            "      [ module[:instance[:name[:statistic]]] ... ]\n"
             "      [ interval [ count ] ]\n"));
 }
 
 /*
  * Sort compare function.