Whamcloud - gitweb
Changelog update
[fs/lustre-release.git] / lustre / utils / parser.c
index 23fece4..a750d4c 100644 (file)
@@ -16,8 +16,8 @@
  * in the LICENSE file that accompanied this code).
  *
  * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
@@ -118,6 +118,11 @@ void Parser_ignore_errors(int ignore)
         ignore_errors = ignore;
 }
 
+/* Returns:
+        0 on success
+        >0 CMD_* values
+        <0 errnos
+*/
 int Parser_execarg(int argc, char **argv, command_t cmds[])
 {
         command_t *cmd;
@@ -129,12 +134,12 @@ int Parser_execarg(int argc, char **argv, command_t cmds[])
                         fprintf(stderr, "%s\n", cmd->pc_help);
                 return rc;
         } else {
-               printf("Try interactive use without arguments or use one of:\n");
+                printf("Try interactive use without arguments or use one of:\n");
                 for (cmd = cmds; cmd->pc_name; cmd++)
                         printf("\"%s\"\n", cmd->pc_name);
                 printf("as argument.\n");
         }
-        return -1;
+        return -EINVAL;
 }
 
 /* returns the command_t * (NULL if not found) corresponding to a
@@ -254,9 +259,9 @@ static char **command_completion(char * text, int start, int end)
         char        * pos;
 
         match_tbl = top_level;
-        
+
         for (table = find_cmd(rl_line_buffer, match_tbl, &pos);
-             table; table = find_cmd(pos, match_tbl, &pos)) 
+             table; table = find_cmd(pos, match_tbl, &pos))
         {
 
                 if (*(pos - 1) == ' ') match_tbl = table->pc_sub_cmd;