summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-10-29 16:19:04 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-10-29 16:19:04 -0700
commit57f92ab532610ef1f95ef3fa4761c424d5541d80 (patch)
tree51eb89b26039a950a9a4352f6f6fe1890d89ea96 /src
parent386653f4d9af2cbb1124aaba76ce2873e94cfd1f (diff)
downloadvyatta-cfg-57f92ab532610ef1f95ef3fa4761c424d5541d80.tar.gz
vyatta-cfg-57f92ab532610ef1f95ef3fa4761c424d5541d80.zip
output "help" text
Diffstat (limited to 'src')
-rw-r--r--src/cli_new.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cli_new.c b/src/cli_new.c
index abc87db..8037909 100644
--- a/src/cli_new.c
+++ b/src/cli_new.c
@@ -557,13 +557,14 @@ int char2val(vtw_def *def, char *value, valstruct *valp)
if (def->def_type_help){
set_at_string(value);
(void)expand_string(def->def_type_help);
- printf("%s\n", exe_string);
- fprintf(stderr, "%s\n", exe_string);
+ fprintf(out_stream, "%s\n", exe_string);
} else {
print_msg("Wrong type of value in %s, "
"need %s\n",
m_path.path_buf + m_path.print_offset,
type_to_name(my_type));
+ fprintf(out_stream, "\"%s\" is not a valid value of type \"%s\"\n",
+ value, type_to_name(my_type));
}
return -1;
}
@@ -573,13 +574,14 @@ int char2val(vtw_def *def, char *value, valstruct *valp)
if (def->def_type_help){
set_at_string(value);
(void)expand_string(def->def_type_help);
- printf("%s\n", exe_string);
- fprintf(stderr, "%s\n", exe_string);
+ fprintf(out_stream, "%s\n", exe_string);
} else {
print_msg("Wrong type of value in %s, "
"need %s\n",
m_path.path_buf + m_path.print_offset,
type_to_name(my_type));
+ fprintf(out_stream, "\"%s\" is not a valid value of type \"%s\"\n",
+ value, type_to_name(my_type));
}
my_free(get_cli_value_ptr()->val);
if (first)
@@ -910,8 +912,7 @@ static boolean check_syn_func(vtw_node *cur,const char* func,int line)
ret = check_syn(cur->vtw_node_left);
if (ret <= 0){
if (expand_string(cur->vtw_node_right->vtw_node_string) == VTWERR_OK) {
- fprintf(out_stream, exe_string);
- fprintf(out_stream, "\n");
+ fprintf(out_stream, "%s\n", exe_string);
}
}
return ret;
@@ -1730,11 +1731,10 @@ boolean validate_value(vtw_def *def, char *cp)
(validate_value_val.val_type != def->def_type)) {
if (def->def_type_help){
(void)expand_string(def->def_type_help);
- printf("%s\n", exe_string);
- fprintf(stderr, "%s\n", exe_string);
+ fprintf(out_stream, "%s\n", exe_string);
} else {
- printf("Incorrect type of %s, need %s\n",
- cp, type_to_name(def->def_type));
+ fprintf(out_stream, "\"%s\" is not a valid value of type \"%s\"\n",
+ cp, type_to_name(def->def_type));
}
ret = FALSE;
goto validate_value_free_and_return;