summaryrefslogtreecommitdiffstats
path: root/git-rev-parse.txt
diff options
context:
space:
mode:
authorJunio C Hamano <junio@kernel.org>2010-08-03 15:15:54 +0000
committerJunio C Hamano <junio@kernel.org>2010-08-03 15:15:54 +0000
commita978876a665cbf17575e06e27f29c77326621c09 (patch)
treee5a708f860ea4caf83f8d08d68c88781f3b87163 /git-rev-parse.txt
parent8ac9d8afca61866e40b7c3bac22175b842e66aa3 (diff)
downloadgit-htmldocs-a978876a665cbf17575e06e27f29c77326621c09.tar.gz
Autogenerated HTML docs for v1.7.2.1-22-ge7bdd
Diffstat (limited to 'git-rev-parse.txt')
-rw-r--r--git-rev-parse.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/git-rev-parse.txt b/git-rev-parse.txt
index 0727f431c..be4c05336 100644
--- a/git-rev-parse.txt
+++ b/git-rev-parse.txt
@@ -184,10 +184,13 @@ scripts the same facilities C builtins have. It works as an option normalizer
(e.g. splits single switches aggregate values), a bit like `getopt(1)` does.
It takes on the standard input the specification of the options to parse and
-understand, and echoes on the standard output a line suitable for `sh(1)` `eval`
+understand, and echoes on the standard output a string suitable for `sh(1)` `eval`
to replace the arguments with normalized ones. In case of error, it outputs
usage on the standard error stream, and exits with code 129.
+Note: Make sure you quote the result when passing it to `eval`. See
+below for an example.
+
Input Format
~~~~~~~~~~~~
@@ -244,7 +247,7 @@ bar= some cool option --bar with an argument
An option group Header
C? option C with an optional argument"
-eval `echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?`
+eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"
------------
SQ-QUOTE