From dev-return-4448-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Wed Mar 21 11:31:08 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 08277180651 for ; Wed, 21 Mar 2018 11:31:07 +0100 (CET) Received: (qmail 8041 invoked by uid 500); 21 Mar 2018 10:31:06 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 8009 invoked by uid 99); 21 Mar 2018 10:31:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Mar 2018 10:31:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D25FFC00D6 for ; Wed, 21 Mar 2018 10:31:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.648 X-Spam-Level: ** X-Spam-Status: No, score=2.648 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id dwWWml1GHh2O for ; Wed, 21 Mar 2018 10:31:03 +0000 (UTC) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D23775F16A for ; Wed, 21 Mar 2018 10:31:02 +0000 (UTC) Received: by mail-io0-f182.google.com with SMTP id q84so549561iod.10 for ; Wed, 21 Mar 2018 03:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=NcPlLqxqbFlyI8DahkW5hTRo71oUgYMcuzUt57ZIbkY=; b=cPvY7JHSRLub+uQ02SiovimIef8cVI7yt6xaufBIVOwDjBtUTImdITst3Mbbco4n69 gsgPrG2auNJrGlS3GMpeWNIHEHQuYl0pfU/fdmZ6ShJDaTM5ZnN8/5j8mwwBf9ze9cTH 8Oeq1vRkqB3aXihuLspnLdtyrWTJDtzV0K3eSJmiQK1XQVQ0kvV7HPEJW2hcahIdhc6r zWfC0axPr+20RWtMTUpBX8HHzcoVlN6tOsiQlUzYxr23Ro3fcozKiHg3lXxxBcQuBb4J GIt1Xzgc+XtLcJWKTfCZG9jFzgHj25TD4c3L7IWWIEJIST9EOqX4TBX+9KJBr2s8/BBN LZIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=NcPlLqxqbFlyI8DahkW5hTRo71oUgYMcuzUt57ZIbkY=; b=AtEuglbTNPUgEPCUGyrd6qWycC8xIN6wu+Opg0gyO8B6osB1EeTY8c+oZb3VWS9R4n 4IKzGX1GjNy6qhcl9ID6EdIMAgAFHE2Nddn9ALgFhe6XgkwQQb8jw0WrffMWmKDazVcz x2rPfjtxA31C/GdJGmAhdSHvRV1LJzxHSwQwux1aqTLd1rxctN8CX0xupIVz2rrLFobq ui0o5rsMntlKy0cMzD72m6XRT1eXFPYFa3jYgpk13mjLiufcr5Y71XcrQoHsghyqgRN+ +XjjW+0HzGjq/iI42taAre+YLR++eRaStAgudvLiKHUxQn3Tkm+/jfOGvq7FJ/HO1LVJ rxQw== X-Gm-Message-State: AElRT7EepowDJXlOCbyi64sD+zWYArlGqGFfvq1gwpS/zy1/Lij1hhNw Ui/ZLy4CKen4Troo3tWnEj4UvYbnHaz+MUrJFeq/K2oy X-Google-Smtp-Source: AIpwx4+Ox7JSVXe2uSJGoM7LdLInTVQfuL2hb6Ye4Q+Bwoevbxcl3mlXCBGxxGoi3UGJHfeEoIL+VLtNNved7uAaheU= X-Received: by 10.107.185.138 with SMTP id j132mr5644506iof.261.1521628255443; Wed, 21 Mar 2018 03:30:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.161.204 with HTTP; Wed, 21 Mar 2018 03:30:54 -0700 (PDT) In-Reply-To: <5fe7275b-d94d-2a5f-6c76-7bef47f505d6@gmx.org> References: <1521569603.23595.60.camel@winder.org.uk> <9dd6a0af-e8e9-d16b-77b5-8c6049a76551@arscreat.com> <5fe7275b-d94d-2a5f-6c76-7bef47f505d6@gmx.org> From: Remko Popma Date: Wed, 21 Mar 2018 19:30:54 +0900 Message-ID: Subject: Re: next generation CliBuilder? To: dev@groovy.apache.org Content-Type: multipart/alternative; boundary="94eb2c081df0a5615f0567e9afc7" --94eb2c081df0a5615f0567e9afc7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 21, 2018 at 5:23 PM, Jochen Theodorou wrote= : > > > Am 21.03.2018 um 02:11 schrieb Paul King: > >> Picocli has always looked like a nice alternative. It wasn't an option >> for me before it had the api but picocli 3 seems to have that covered. >> > > can you refresh my memory about the position of JCommander in this? I see > some overlap. And if we go with Picoli, we should probably explain the > people in what case they should use what and how. > > Fair question. What distinguishes picocli from JCommander (and many other CLI libraries): - JCommander has an annotations API, while picocli has both an annotations and a programmatic API . The programmatic API is needed to support the dynamic features of CliBuilder. - picocli has easily customized usage help with ANSI colors - picocli-based apps and scripts can have command line autocompletion in bash and zsh - picocli offers tight integration for Groovy scripts via the @PicocliScript annotation and AST transformation (see the Groovy Scripts on Steroids post) - in picocli, both options and positional parameters can be strongly typed. JCommander has strongly typed options, but positional parameters= is an untyped list of strings. - picocli supports clustered short options , so you can say -xvfInputFile as well as -x -v -f=3DInputFile. JCommander only supports the latter AFAIK. - picocli has a range-based arity model that allows a minimum, maximum and variable number of parameters, e.g, "1..*", "3..5". With JCommander one needs to choose between minimum arity or variable arity, and with variable arity one cannot have strong typing - Strings only. - picocli has convenience APIs that reduce the boilerplate code for command line applications to a single line of code Picocli and JCommander both have: - quality documentation - support for subcommands - support for multi-value options, splitting an argument into multiple values, and map-like options (e.g., -Dkey=3Dvalue) JCommander features not in picocli (but on the todo list): - internationalization - support for suppressing password echo to the console - support for case-insensitive and abbreviated options For more details, this CLI library comparison page may be useful. Dustin Marx=E2=80=98s article series on command line interfaces, especially= the summary post , may also be of interest (although it covers an old version of picocli - 0.9.7). Remko > bye Jochen > --94eb2c081df0a5615f0567e9afc7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On W= ed, Mar 21, 2018 at 5:23 PM, Jochen Theodorou <blackdrag@gmx.org> wrote:


Am 21.03.2018 um 02:11 schrieb Paul King:
Picocli has always looked like a nice alternative. It wasn't an option = for me before it had the api but picocli 3 seems to have that covered.

can you refresh my memory about the position of JCommander in this? I see s= ome overlap. And if we go with Picoli, we should probably explain the peopl= e in what case they should use what and how.

Fair question. What distinguishes picocli from JC= ommander (and many other CLI libraries):

Picocli and JCommande= r both have:
  • quality document= ation=C2=A0
  • support for subcommands=C2=A0
  • support for multi= -value options, splitting an argument into multiple values, and map-like op= tions (e.g., -Dkey=3Dvalue)
  • =

JCommander features not in picocli (but on t= he todo list):=C2=A0
  • internationalization=C2=A0
  • s= upport for=C2=A0suppressing password echo to the console=C2=A0
  • supp= ort for case-insensitive and abbreviated options

For more details, this=C2=A0CLI library comparison page may be useful. Dustin Marx=E2=80=98s arti= cle series on command line interfaces, especially the summary post, may also be of interest (although it covers an old = version of picocli - 0.9.7).
<= br>
Remko
=C2=A0
bye Jochen

--94eb2c081df0a5615f0567e9afc7--