Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
b=1414
[fs/lustre-release.git]
/
lustre
/
utils
/
parser.h
diff --git
a/lustre/utils/parser.h
b/lustre/utils/parser.h
index
8f22505
..
a1f899b
100644
(file)
--- a/
lustre/utils/parser.h
+++ b/
lustre/utils/parser.h
@@
-2,7
+2,13
@@
#define _PARSER_H_
#define HISTORY 100 /* Don't let history grow unbounded */
#define _PARSER_H_
#define HISTORY 100 /* Don't let history grow unbounded */
-#define MAXARGS 100
+#define MAXARGS 512
+
+#define CMD_COMPLETE 0
+#define CMD_INCOMPLETE 1
+#define CMD_NONE 2
+#define CMD_AMBIG 3
+#define CMD_HELP 4
typedef struct parser_cmd {
char *pc_name;
typedef struct parser_cmd {
char *pc_name;
@@
-28,6
+34,7
@@
void Parser_init(char *, command_t *); /* Set prompt and load command list */
int Parser_commands(void); /* Start the command parser */
void Parser_qhelp(int, char **); /* Quick help routine */
int Parser_help(int, char **); /* Detailed help routine */
int Parser_commands(void); /* Start the command parser */
void Parser_qhelp(int, char **); /* Quick help routine */
int Parser_help(int, char **); /* Detailed help routine */
+void Parser_ignore_errors(int ignore); /* Set the ignore errors flag */
void Parser_printhelp(char *); /* Detailed help routine */
void Parser_exit(int, char **); /* Shuts down command parser */
int Parser_execarg(int argc, char **argv, command_t cmds[]);
void Parser_printhelp(char *); /* Detailed help routine */
void Parser_exit(int, char **); /* Shuts down command parser */
int Parser_execarg(int argc, char **argv, command_t cmds[]);
@@
-58,5
+65,10
@@
char *Parser_strarg(char *inp, const char *prompt, const char *deft,
/* Extracts an integer from a string with a base */
int Parser_arg2int(const char *inp, long *result, int base);
/* Extracts an integer from a string with a base */
int Parser_arg2int(const char *inp, long *result, int base);
+/* Convert human readable size string to and int; "1k" -> 1000 */
+int Parser_size(int *sizep, char *str);
+
+/* Convert a string boolean to an int; "enable" -> 1 */
+int Parser_bool(int *b, char *str);
#endif
#endif