Misc documentation fixes and improvements
PATCH 1/1 Misc documentation fixes and improvements
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.
---
cg-Xlib +1 -1
@@ -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 }
cg-admin-uncommit +2 -2
@@ -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
cg-commit +1 -1
@@ -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::
cg-diff +1 -1
@@ -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.
cg-help +4 -3
@@ -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)
cg-log +1 -1
@@ -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)
Signature · 1 line
Jonas Fonseca
Dear diary, on Wed, Jul 20, 2005 at 02:05:01PM CEST, I got a letter where Jonas Fonseca <[email protected]> told me that...
Quoted 11 lines
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]>---
cg-diff line 9
Quoted 8 lines
cg-diff +1
-1@@ -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.
I dropped this hunk (seems to only lose clarity).
cg-help ADVANCED_COMMANDS="$(ls $bin_path/cg-adm · line 97
Quoted 12 lines
cg-help +1
-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)
And I dropped the Usage string here altogether.
Thanks,
Signature · 4 lines
Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ If you want the holes in your knowledge showing up try teaching someone. -- Alan Cox