You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2016/06/29 19:38:42 UTC
qpid-dispatch git commit: NO-JIRA: Don't hide stderr in help2txt.
Repository: qpid-dispatch
Updated Branches:
refs/heads/master 4797f4d1b -> 1786afeb6
NO-JIRA: Don't hide stderr in help2txt.
The help2txt tool was hiding stderr output, making it difficult to tell why it
failed if something went wrong.
Modified qdrouterd to print --help text to stdout not stderr.
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/1786afeb
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/1786afeb
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/1786afeb
Branch: refs/heads/master
Commit: 1786afeb6bbba35684eaf32da4dd037fe8f75c47
Parents: 4797f4d
Author: Alan Conway <ac...@redhat.com>
Authored: Wed Jun 29 15:35:47 2016 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Wed Jun 29 15:38:06 2016 -0400
----------------------------------------------------------------------
doc/CMakeLists.txt | 6 +++---
doc/man/help2txt.py | 12 ++++--------
router/src/main.c | 18 +++++++++---------
3 files changed, 16 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1786afeb/doc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index d140021..b8d56b8 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -126,13 +126,13 @@ if(BUILD_DOCS)
list(APPEND DOC_DEPENDS ${bin}/book.pdf)
install_doc(FILES ${bin}/book.pdf DESTINATION ${QD_DOC_INSTALL_DIR})
else(DBLATEX_EXE)
- message("Not generating PDF user guide: dblatex not found")
+ message(STATUS "dblatex not found: not generating PDF")
endif(DBLATEX_EXE)
else(A2X_EXE)
- message("Not generating Unix Man pages or PDF user guide: a2x not found")
+ message(STATUS "a2x not found: not generating man pages or PDF")
endif(A2X_EXE)
else(ASCIIDOC_EXE)
- message("No generated documentation: asciidoc not found")
+ message(STATUS "asciidoc not found: not generating HTML, man pages or PDF")
endif(ASCIIDOC_EXE)
add_custom_target(doc ${DOC_TARGET} DEPENDS ${DOC_DEPENDS})
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1786afeb/doc/man/help2txt.py
----------------------------------------------------------------------
diff --git a/doc/man/help2txt.py b/doc/man/help2txt.py
index 3bf35d8..a1eca2c 100644
--- a/doc/man/help2txt.py
+++ b/doc/man/help2txt.py
@@ -20,7 +20,7 @@
"""
Convert --help output of a program into asciidoc text format.
"""
-
+from __future__ import print_function
import re, sys
from qpid_dispatch_internal.compat.subproc import check_output, STDOUT, CalledProcessError
from os import path
@@ -51,12 +51,8 @@ def help2txt(help_out):
def main(argv):
if len(argv) < 2: raise ValueError("Wrong number of arguments: "+usage)
program = argv[1:]
- print help2txt(check_output(program, stderr=STDOUT))
+ print(help2txt(check_output(program)))
if __name__ == "__main__":
- try:
- main(sys.argv)
- except CalledProcessError, e:
- if hasattr(e, "output") and e.output:
- print "\n%s\n\n%s\n" % (e, e.output)
- raise
+ main(sys.argv)
+
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1786afeb/router/src/main.c
----------------------------------------------------------------------
diff --git a/router/src/main.c b/router/src/main.c
index b121043..fa895d4 100644
--- a/router/src/main.c
+++ b/router/src/main.c
@@ -266,15 +266,15 @@ static void daemon_process(const char *config_path, const char *python_pkgdir,
#define DEFAULT_DISPATCH_PYTHON_DIR QPID_DISPATCH_HOME_INSTALLED "/python"
void usage(char **argv) {
- fprintf(stderr, "Usage: %s [OPTIONS]\n\n", argv[0]);
- fprintf(stderr, " -c, --config=PATH (%s)\n", DEFAULT_CONFIG_PATH);
- fprintf(stderr, " Load configuration from file at PATH\n");
- fprintf(stderr, " -I, --include=PATH (%s)\n", DEFAULT_DISPATCH_PYTHON_DIR);
- fprintf(stderr, " Location of Dispatch's Python library\n");
- fprintf(stderr, " -d, --daemon Run process as a SysV-style daemon\n");
- fprintf(stderr, " -P, --pidfile If daemon, the file for the stored daemon pid\n");
- fprintf(stderr, " -U, --user If daemon, the username to run as\n");
- fprintf(stderr, " -h, --help Print this help\n");
+ fprintf(stdout, "Usage: %s [OPTIONS]\n\n", argv[0]);
+ fprintf(stdout, " -c, --config=PATH (%s)\n", DEFAULT_CONFIG_PATH);
+ fprintf(stdout, " Load configuration from file at PATH\n");
+ fprintf(stdout, " -I, --include=PATH (%s)\n", DEFAULT_DISPATCH_PYTHON_DIR);
+ fprintf(stdout, " Location of Dispatch's Python library\n");
+ fprintf(stdout, " -d, --daemon Run process as a SysV-style daemon\n");
+ fprintf(stdout, " -P, --pidfile If daemon, the file for the stored daemon pid\n");
+ fprintf(stdout, " -U, --user If daemon, the username to run as\n");
+ fprintf(stdout, " -h, --help Print this help\n");
}
int main(int argc, char **argv)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org