Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitcli: parse-options lets you omit tail of long options
author
Junio C Hamano
<gitster@pobox.com>
Thu, 4 Oct 2012 17:13:49 +0000
(10:13 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 5 Oct 2012 03:30:27 +0000
(20:30 -0700)
Describe the behaviour, but do warn people against taking it too
literally and expect an abbreviation valid today will stay valid
forever.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitcli.txt
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
bafc478
)
diff --git
a/Documentation/gitcli.txt
b/Documentation/gitcli.txt
index f6ba90c2da8f381bc714762f24bbfc33fa82b356..3bc1500eda540cf7277e602b3d0ade1a3c1dc1be 100644
(file)
--- a/
Documentation/gitcli.txt
+++ b/
Documentation/gitcli.txt
@@
-93,7
+93,7
@@
ENHANCED OPTION PARSER
From the git 1.5.4 series and further, many git commands (not all of them at the
time of the writing though) come with an enhanced option parser.
From the git 1.5.4 series and further, many git commands (not all of them at the
time of the writing though) come with an enhanced option parser.
-Here is a
n exhaustive
list of the facilities provided by this option parser.
+Here is a list of the facilities provided by this option parser.
Magic Options
Magic Options
@@
-137,6
+137,16
@@
options. This means that you can for example use `git rm -rf` or
`git clean -fdx`.
`git clean -fdx`.
+Abbreviating long options
+~~~~~~~~~~~~~~~~~~~~~~~~~
+Commands that support the enhanced option parser accepts unique
+prefix of a long option as if it is fully spelled out, but use this
+with a caution. For example, `git commit --amen` behaves as if you
+typed `git commit --amend`, but that is true only until a later version
+of Git introduces another option that shares the same prefix,
+e.g `git commit --amenity" option.
+
+
Separating argument from the option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can write the mandatory option parameter to an option as a separate
Separating argument from the option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can write the mandatory option parameter to an option as a separate