Fix displaying of an error message when cg-help is called with unknown
command and use $USAGE so the correct cg-help usage string is printed.
Drop useless use of cat in print_help(). Improve the asciidoc markup.
Signed-off-by: Jonas Fonseca <[EMAIL PROTECTED]>
---
diff --git a/cg-Xlib b/cg-Xlib
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -172,7 +172,7 @@ print_help()
which "cg-$1" >/dev/null 2>&1 || exit 1
sed -n '/^USAGE=/,0s/.*"\(.*\)"/Usage: \1/p' < $(which cg-$1)
echo
- cat $(which cg-$1) | sed -n '3,/^$/s/^# *//p'
+ sed -n '3,/^$/s/^# *//p' < $(which cg-$1)
exit
}
diff --git a/cg-admin-uncommit b/cg-admin-uncommit
--- a/cg-admin-uncommit
+++ b/cg-admin-uncommit
@@ -14,14 +14,14 @@
# -t::
# This optional parameter makes `cg-admin-uncommit` to roll back
# the tree as well to the previous commit. Without this option
-# (by default) Cogito keeps the tree in its current state,
+# (by default) 'Cogito' keeps the tree in its current state,
# therefore generating tree with local changes against the target
# commit, consisting of the changes in the rolled back commits.
#
# CAVEATS
# ---
# This command can be dangerous! It is safe to do as long as you do not
-# push the commit out in the meantime, but you should NEVER uncommit an
+# push the commit out in the meantime, but you should 'NEVER' uncommit an
# already pushed out commit. Things will break for the pullers since you
# just broke the fast-forward merging mechanism (the new commit is not
# descendant of the previous one). The future push scripts will refuse
diff --git a/cg-commit b/cg-commit
--- a/cg-commit
+++ b/cg-commit
@@ -17,7 +17,7 @@
# ---
# -C::
# Make `cg-commit` ignore the cache and just commit the thing as-is.
-# Note, this is used internally by Cogito when merging. This option
+# Note, this is used internally by 'Cogito' when merging. This option
# does not make sense when files are given on the command line.
#
# -mMESSAGE::
diff --git a/cg-diff b/cg-diff
--- a/cg-diff
+++ b/cg-diff
@@ -3,7 +3,7 @@
# Make a diff between two GIT trees.
# Copyright (c) Petr Baudis, 2005
#
-# Outputs a diff for converting the first tree to the second one.
+# Outputs a diff for converting between two trees.
# By default compares the current working tree to the state at the
# last commit. The output will automatically be displayed in a pager
# unless it is piped to a program.
diff --git a/cg-help b/cg-help
--- a/cg-help
+++ b/cg-help
@@ -14,7 +14,7 @@
# OPTIONS
# ---
# -c::
-# Colorize to the output.
+# Colorize the output.
USAGE="cg-help [-c] [cg-COMMAND | COMMAND]"
_git_repo_unneeded=1
@@ -76,7 +76,8 @@ colorize() {
if [ "$ARGS" ]; then
cmd=$(echo "${ARGS[0]}" | sed 's/^cg-//')
- ( print_help $cmd | colorize ) && exit
+ print_help $cmd | colorize
+ [ "${PIPESTATUS[0]}" -eq 0 ] && exit
echo "cg-help: no help available for command \"${ARGS[0]}\""
echo "Call cg-help without any arguments for the list of available
commands"
exit 1
@@ -90,7 +91,7 @@ ADVANCED_COMMANDS="$(ls $bin_path/cg-adm
colorize <<__END__
The Cogito version control system $(cg-version)
-Usage: cg-COMMAND [ARG]...
+Usage: $USAGE
Available commands:
$(print_command_listing $REGULAR_COMMANDS)
diff --git a/cg-log b/cg-log
--- a/cg-log
+++ b/cg-log
@@ -14,7 +14,7 @@
# cg-log then displays only changes in those files.
#
# -c::
-# Colorize to the output. The used colors are listed below together
+# Colorize the output. The used colors are listed below together
# with information about which log output (summary, full or both)
# they apply to:
# - `author`: 'cyan' (both)
--
Jonas Fonseca
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html