<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/parse-options.c, branch v1.5.4.4</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.5.4.4</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.5.4.4'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2008-01-26T18:53:31Z</updated>
<entry>
<title>parse-options: catch likely typo in presense of aggregated options.</title>
<updated>2008-01-26T18:53:31Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2008-01-26T11:26:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=3a9f0f41db87e197708f84aeb2487bc983f99c9c'/>
<id>urn:sha1:3a9f0f41db87e197708f84aeb2487bc983f99c9c</id>
<content type='text'>
If options are aggregated, and that the whole token is an exact
prefix of a long option that is longer than 2 letters, reject
it.  This is to prevent a common typo:

	$ git commit -amend

to get interpreted as "commit all with message 'end'".

The typo check isn't performed if there is no aggregation,
because the stuck form is the recommended one.  If we have `-o`
being a valid short option that takes an argument, and --option
a long one, then we _MUST_ accept -option as "'o' option with
argument 'ption'", which is our official recommended form.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Force the sticked form for options with optional arguments.</title>
<updated>2007-12-22T18:26:08Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-12-21T10:41:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c43a24834a9babd3ddd9c27ccc81174c2cb36859'/>
<id>urn:sha1:c43a24834a9babd3ddd9c27ccc81174c2cb36859</id>
<content type='text'>
This forbids "git tag -n &lt;number&gt; -l" we allowed earlier, so
adjust t7004 while at it.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
</content>
</entry>
<entry>
<title>parse-options: Allow to hide options from the default usage.</title>
<updated>2007-11-23T06:11:28Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-11-19T09:21:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=dd3bf0f4a5bab17011e94bfeb808ee64dd2ad040'/>
<id>urn:sha1:dd3bf0f4a5bab17011e94bfeb808ee64dd2ad040</id>
<content type='text'>
This is useful for backward-compatibility aliases, or very advanced command
line switches introduced for internal git usages and have no real use for a
user.

parse-options still shows them if the user asks for --help-all.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options new features.</title>
<updated>2007-11-12T00:54:15Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-11-07T10:20:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=db7244bd5be12e389badb9cec621dbbcfa11f59a'/>
<id>urn:sha1:db7244bd5be12e389badb9cec621dbbcfa11f59a</id>
<content type='text'>
options flags:
~~~~~~~~~~~~~
  PARSE_OPT_NONEG allow the caller to disallow the negated option to exists.

option types:
~~~~~~~~~~~~
  OPTION_BIT: ORs (or NANDs) a mask.
  OPTION_SET_INT: force the value to be set to this integer.
  OPTION_SET_PTR: force the value to be set to this pointer.

helper:
~~~~~~
  HAS_MULTI_BITS (in git-compat-util.h) is a bit-hack to check if an
  unsigned integer has more than one bit set, useful to check if conflicting
  options have been used.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options: abbreviation engine fix.</title>
<updated>2007-11-06T06:46:45Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2007-11-05T13:15:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=243e0614e0f8783599b20106b50eee56d0a17332'/>
<id>urn:sha1:243e0614e0f8783599b20106b50eee56d0a17332</id>
<content type='text'>
When an option could be an ambiguous abbreviation of two options, the code
used to error out.  Even if an exact match would have occured later.

Test and original patch by Pierre Habouzit.

Signed-off-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options: allow callbacks to take no arguments at all.</title>
<updated>2007-10-30T04:03:31Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-10-15T22:32:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f481e22a145ed17e85b68bf8ce2de4b80dfa4323'/>
<id>urn:sha1:f481e22a145ed17e85b68bf8ce2de4b80dfa4323</id>
<content type='text'>
Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
<entry>
<title>parse-options: Allow abbreviated options when unambiguous</title>
<updated>2007-10-30T04:03:30Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2007-10-14T16:54:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7f275b91520d31bfbe43ec5a9bbaf8ac6e663ce0'/>
<id>urn:sha1:7f275b91520d31bfbe43ec5a9bbaf8ac6e663ce0</id>
<content type='text'>
When there is an option "--amend", the option parser now recognizes
"--am" for that option, provided that there is no other option beginning
with "--am".

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
<entry>
<title>Add shortcuts for very often used options.</title>
<updated>2007-10-30T04:03:30Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-10-14T09:05:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=0ce865b134f8ccd60f6e584744144b0978a9fdf2'/>
<id>urn:sha1:0ce865b134f8ccd60f6e584744144b0978a9fdf2</id>
<content type='text'>
It helps with consistency of the help strings, for example.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
<entry>
<title>parse-options: make some arguments optional, add callbacks.</title>
<updated>2007-10-30T04:03:30Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2007-10-14T23:45:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ffe659f94d793375fca97dd296422fc10c155016'/>
<id>urn:sha1:ffe659f94d793375fca97dd296422fc10c155016</id>
<content type='text'>
* add the possibility to use callbacks to parse some options, this can
  help implementing new options kinds with great flexibility. struct option
  gains a callback pointer and a `defval' where callbacks user can put
  either integers or pointers. callbacks also can use the `value' pointer
  for anything, preferably to the pointer to the final storage for the value
  though.

* add a `flag' member to struct option to make explicit that this option may
  have an optional argument. The semantics depends on the option type. For
  INTEGERS, it means that if the switch is not used in its
  --long-form=&lt;value&gt; form, and that there is no token after it or that the
  token does not starts with a digit, then it's assumed that the switch has
  no argument. For STRING or CALLBACK it works the same, except that the
  condition is that the next atom starts with a dash. This is needed to
  implement backward compatible behaviour with existing ways to parse the
  command line. Its use for new options is discouraged.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
<entry>
<title>Rework make_usage to print the usage message immediately</title>
<updated>2007-10-30T04:03:30Z</updated>
<author>
<name>Alex Riesen</name>
<email>raa.lkml@gmail.com</email>
</author>
<published>2007-10-13T22:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f389c808b6774fb0a1fc54cf2563a7b3038dd1d4'/>
<id>urn:sha1:f389c808b6774fb0a1fc54cf2563a7b3038dd1d4</id>
<content type='text'>
Signed-off-by: Alex Riesen &lt;raa.lkml@gmail.com&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
</feed>
