All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Mike Ralphson <mike.ralphson@gmail.com>
Cc: Robin Rosenberg <robin.rosenberg.lists@dewire.com>,
	Marek Zawirski <marek.zawirski@gmail.com>,
	git@vger.kernel.org
Subject: Re: [JGIT PATCH 1/1] jgit: create a tag command
Date: Sat, 12 Jul 2008 03:42:06 +0000	[thread overview]
Message-ID: <20080712034206.GA16101@spearce.org> (raw)
In-Reply-To: <20080712030104.GB15838@spearce.org>

"Shawn O. Pearce" <spearce@spearce.org> wrote:
> Mike Ralphson <mike.ralphson@gmail.com> wrote:
> 
> > > I think we are at the point where we need to either write a
> > > #@!*(!@(! command line option parser, import one, or stop writing
> > > command line programs.  I would certainly appreciate any opinion
> > > you might have on the matter.
> > 
> > a) is a distraction, c) is a backwards step, so maybe b) wins.
> 
> So I looked at GNU getopt and its at least smaller than Apache
> Commons,

Probably the state-of-the-arg is args4j:

  https://args4j.dev.java.net/

It uses Java 5 annotations to setup the argument parsing:

  public class SampleMain {

    @Option(name="-r",usage="recursively run something")
    private boolean recursive;

    @Option(name="-o",usage="output to this file",metaVar="OUTPUT")
    private File out = new File(".");

    @Option(name="-str")        // no usage
    private String str = "(default value)";
  ...

I'm usually not a big fan of reflection, but it may make sense to
take advantage of it in a case like this, and just import args4j
into our command line tools.

args4j is provided under the MIT license.

-- 
Shawn.

  reply	other threads:[~2008-07-12  3:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06 22:41 [JGIT PATCH 1/1] jgit: create a tag command Robin Rosenberg
2008-07-06 23:16 ` Robin Rosenberg
2008-07-10 15:31   ` Mike Ralphson
2008-07-10 18:02     ` Robin Rosenberg
2008-07-11 10:50       ` Differences between git-applu and GNU patch (was: [JGIT PATCH 1/1] jgit: create a tag command) Jakub Narebski
2008-07-11  2:05     ` [JGIT PATCH 1/1] jgit: create a tag command Shawn O. Pearce
2008-07-11  8:28       ` Robin Rosenberg
2008-07-11  8:45       ` Mike Ralphson
2008-07-12  3:01         ` Shawn O. Pearce
2008-07-12  3:42           ` Shawn O. Pearce [this message]
2008-07-17 21:31             ` Robin Rosenberg
2008-07-17 21:45               ` Shawn O. Pearce
2008-07-17 22:24                 ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080712034206.GA16101@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=marek.zawirski@gmail.com \
    --cc=mike.ralphson@gmail.com \
    --cc=robin.rosenberg.lists@dewire.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.