diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-28 10:12:47 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-28 10:12:47 -0700 |
commit | 8960ab02736d7e13a3e8910da4dea7cb03629fbb (patch) | |
tree | 0bccd86e83c78f1c3a36070dd4fe74f05e5a2c1d | |
parent | 2e676eab9d35e8faf0df8676fc832c3178ff3feb (diff) | |
parent | 0c938c8f6e3da7ab69ad018d8b3f6604b4506479 (diff) | |
download | vyatta-cfg-8960ab02736d7e13a3e8910da4dea7cb03629fbb.tar.gz vyatta-cfg-8960ab02736d7e13a3e8910da4dea7cb03629fbb.zip |
Merge branch 'larkspur' of suva.vyatta.com:/git/vyatta-cfg into larkspur
-rw-r--r-- | debian/changelog | 37 | ||||
-rwxr-xr-x | etc/bash_completion.d/20vyatta-cfg | 21 | ||||
-rw-r--r-- | src/cli_new.c | 6 | ||||
-rw-r--r-- | src/commit2.c | 1 |
4 files changed, 54 insertions, 11 deletions
diff --git a/debian/changelog b/debian/changelog index a3901a6..576a860 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,40 @@ +vyatta-cfg (0.16.103+larkspur4) unstable; urgency=low + + * handle single quotes in comp_help + + -- An-Cheng Huang <ancheng@vyatta.com> Tue, 27 Jul 2010 17:39:11 -0700 + +vyatta-cfg (0.16.103+larkspur3) unstable; urgency=low + + * allow commit hook commands to write to stdout. + + -- Michael Larson <slioch@slioch.vyatta.com> Fri, 23 Jul 2010 13:18:10 -0700 + +vyatta-cfg (0.16.103+larkspur2) unstable; urgency=low + + * remove comment feature. + + -- Michael Larson <slioch@slioch.vyatta.com> Thu, 22 Jul 2010 18:09:23 -0700 + +vyatta-cfg (0.16.103+larkspur1) unstable; urgency=low + + * UNRELEASED + + -- An-Cheng Huang <ancheng@vyatta.com> Thu, 22 Jul 2010 17:17:39 -0700 + +vyatta-cfg (0.16.103) unstable; urgency=low + + * output comp_help in addition to normal help + * change quoting + + -- An-Cheng Huang <ancheng@vyatta.com> Wed, 21 Jul 2010 18:35:40 -0700 + +vyatta-cfg (0.16.102) unstable; urgency=low + + * fix for bug 5882. + + -- Michael Larson <slioch@slioch.vyatta.com> Wed, 21 Jul 2010 16:34:56 -0700 + vyatta-cfg (0.16.101) unstable; urgency=low * fix for bug 5887 diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 44e8fb5..80e7777 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -725,10 +725,6 @@ generate_help_text () declare -a helps eval "items=( \"\${$1[@]}\" )" eval "helps=( \"\${$2[@]}\" )" - if [ -n "$vyatta_cfg_comp_help" ]; then - vyatta_help_text="\\n${vyatta_cfg_comp_help}" - return 0 - fi vyatta_help_text="\\nPossible completions:" for (( idx = 0; idx < ${#items[@]}; idx++ )); do vyatta_help_text="${vyatta_help_text}\\n\\x20\\x20" @@ -741,6 +737,18 @@ generate_help_text () fi vyatta_help_text="${vyatta_help_text}${helps[$idx]}" done + if [ -n "$vyatta_cfg_comp_help" ]; then + local hstr=${vyatta_cfg_comp_help//\'/\'\\\\\\\'\'} + vyatta_help_text+="\\n\\nDetailed information:\\n" + local sIFS=$IFS + IFS='
' + local chstr=$(echo -en "$hstr\n" \ + | while read comp_help_line; do + echo "vyatta_help_text+=' $comp_help_line\\n';" + done) + eval "$chstr" + IFS=$sIFS + fi } # this fills in $vyatta_help_text @@ -1038,8 +1046,7 @@ vyatta_config_complete () fi if (( ${#COMP_WORDS[@]} < 2 )); then - declare -a hitems=( "comment" \ - "commit" \ + declare -a hitems=( "commit" \ "copy" \ "delete" \ "discard" \ @@ -1054,7 +1061,6 @@ vyatta_config_complete () "set" \ "show" ) declare -a hstrs=( \ - "Add comment to this configuration element" \ "Commit the current set of changes" \ "Copy a configuration element" \ "Delete a configuration element" \ @@ -1405,7 +1411,6 @@ complete -F vyatta_loadsave_complete save complete -F vyatta_loadsave_complete load complete -F vyatta_loadsave_complete merge complete -F vyatta_loadkey_complete loadkey -complete -F vyatta_config_complete comment complete -F vyatta_config_complete copy complete -F vyatta_config_complete rename diff --git a/src/cli_new.c b/src/cli_new.c index 19aae1c..b0535d8 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -117,8 +117,6 @@ void bye(const char *msg, ...) fprintf(out_stream, "%s failed\n", (cli_operation_name) ? cli_operation_name : "Operation"); - if (is_silent_msg()) - exit(-1); va_start(ap, msg); if (is_echo()) printf("echo \""); @@ -2447,8 +2445,9 @@ system_out(const char *cmd, const char **outbuf) close( cp[0]); int ret = system(cmd); + close( cp[1]); - exit(ret); + exit(WEXITSTATUS(ret)); } else { //parent @@ -2463,6 +2462,7 @@ system_out(const char *cmd, const char **outbuf) int status; wait(&status); close(cp[0]); + return WEXITSTATUS(status); } } diff --git a/src/commit2.c b/src/commit2.c index e3cc3df..05b3d9d 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -368,6 +368,7 @@ main(int argc, char** argv) setenv(ENV_COMMIT_STATUS,"FAILURE",1); } struct dirent *dirp = NULL; + restore_output(); while ((dirp = readdir(dp)) != NULL) { if (strcmp(dirp->d_name, ".") != 0 && strcmp(dirp->d_name, "..") != 0) { |