Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : openlmi-tools-lmiwbem
---------------------------------------------------------------
commit 48b5941435917613a6a9e23acbe381c1d1880cb4
Author: Michal Minar <miminar(a)redhat.com>
Date: Tue Jun 17 13:15:13 2014 +0200
lmi: extended manpage, improved help
---------------------------------------------------------------
cli/lmi/scripts/_metacommand/toplevel.py | 10 +++++-----
cli/man/generate.sh | 27 ++++++++++++++++++++++++++-
cli/man/lmi.1 | 16 +++++++++++++++-
3 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/cli/lmi/scripts/_metacommand/toplevel.py
b/cli/lmi/scripts/_metacommand/toplevel.py
index a0372a7..419a856 100644
--- a/cli/lmi/scripts/_metacommand/toplevel.py
+++ b/cli/lmi/scripts/_metacommand/toplevel.py
@@ -57,14 +57,14 @@ Options:
--version Print version of '%(cmd)s' in use and quit.
Handling hosts:
- If no --host or --hosts-file given the "localhost" is tried. When running
- under root with Pegasus CIMOM, this results in a connection over unix
- socket (without the need for credentials).
+ If no --host or --hosts-file are given, the "localhost" will be tried.
When
+ running under root with Pegasus CIMOM, this results in a connection over
+ unix socket (no need to supply credentials).
Hosts may contain embedded credentials e.g.:
http://user:passwd@hostname:5988
- Avoid supplying them on command line though since arguments are visible in
- process table. Use --hosts-file option instead.
+ Avoid supplying them on command line though. Always prefer the --hosts-file
+ option.
"""
import docopt
diff --git a/cli/man/generate.sh b/cli/man/generate.sh
index a8a8e8d..e2b4dd9 100755
--- a/cli/man/generate.sh
+++ b/cli/man/generate.sh
@@ -16,6 +16,8 @@ configuration_file=`mktemp`
# pusg - parse usage
# wopt - wait for options
# popt - parse options
+# whts - wait for hosts handling section
+# phts - parse hosts handling section
state="desc"
re_option="^([[:blank:]]+)((-[-[:alpha:]_]+)"
re_option+="(\ [][:alpha:]<>_()[|-]+)*)(\ \ +(.*))?"
@@ -76,7 +78,7 @@ while IFS= read line; do
popt*)
if [[ "$line" =~ ^[[:blank:]]*$ ]]; then
printf "\n"
- break
+ state="whts"
elif [[ "$line" =~ $re_option ]]; then
opt_count=`echo $state | sed 's/^popt\([[:digit:]]\+\)/\1/'`
[ "$opt_count" -gt 0 ] && printf '\n'
@@ -89,6 +91,29 @@ while IFS= read line; do
fi
;;
+ "whts")
+ if [[ "$line" =~ ^[Hh]andling\ [Hh]osts ]]; then
+ printf ".SH HOSTS HANDLING\n"
+ state="phts"
+ fi
+ ;;
+
+ "phts")
+ if [[ "$line" =~ ^$ ]]; then
+ new_paragraph=1
+ elif ! [[ "$line" =~ ^[^[:space:]] ]]; then
+ if [[ ${new_paragraph:-0} = 1 ]]; then
+ printf ".P\n"
+ new_paragraph=0
+ fi
+ printf "$line\n" | sed -e 's/^ \{4\}//' -e
's/\s\+$//' \
+ -e 's/\s*\(--[[:alnum:]-]\+\|<[[:alnum:]_-]\+>\)\s\+/\n.B
\1\n/g' \
+ -e 's/\s*\(--[[:alnum:]-]\+\|<[[:alnum:]_-]\+>\)$/\n.B
\1/g'
+ else
+ break
+ fi
+ ;;
+
*) break
;;
diff --git a/cli/man/lmi.1 b/cli/man/lmi.1
index d402bf5..d3b771b 100644
--- a/cli/man/lmi.1
+++ b/cli/man/lmi.1
@@ -1,4 +1,4 @@
-.TH lmi 1 "October 2013" "openlmi-scripts 0.2.2" "User
Commands"
+.TH lmi 1 "June 2014" "openlmi-scripts 0.9.1.1" "User
Commands"
.SH NAME
lmi \- meta-command for managing systems with OpenLMI providers
@@ -65,6 +65,20 @@ Show this text and quit.
.TP
.I --version
Print version of 'lmi' in use and quit.
+.SH HOSTS HANDLING
+If no
+.B --host
+or
+.B --hosts-file
+are given, the "localhost" will be tried. When
+running under root with Pegasus CIMOM, this results in a connection over
+unix socket (no need to supply credentials).
+.P
+Hosts may contain embedded credentials e.g.:
+
http://user:passwd@hostname:5988
+Avoid supplying them on command line though. Always prefer the
+.B --hosts-file
+option.
.SH CONFIGURATION
There is a system-wide configuration file located at
`/etc/openlmi/lmi.conf` and user configuration file searched at `~/.lmirc`.