From nobody Fri Feb 19 14:07:05 2021 Authentication-Results: mail-b.sr.ht; dkim=pass header.d=codesections.com header.i=@codesections.com Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by mail-b.sr.ht (Postfix) with ESMTPS id BCB4311F092 for <~skeeto/public-inbox@lists.sr.ht>; Fri, 19 Feb 2021 14:07:04 +0000 (UTC) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codesections.com; s=default; t=1613743624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vXGp9Bdte3ExZvMIbLS3ifP2G9XHwD9izsQx0hYy7mQ=; b=BOWrkOql4HO8ybx6S3Pnv13BX7bKcnecaMTuvVUST4wQmL3DKqm6wz9V3lSFIqY1D8Iu4V Cr/lyumVO9E0LQB+VcXt8jw+ADxjWtjJFr/25P7FyH6TqaAU8WkpfAgbwbmsEqU4Gizl/g lhbCBb5/CxzwQtZBcUZYOzbDOsej3Ok= Date: Fri, 19 Feb 2021 14:07:03 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Daniel Sockwell" Message-ID: <748d39f5264bf11111ee06b52ab468f1@codesections.com> Subject: Re: quick question re: Conventions for Command Line Options To: "Christopher Wellons" Cc: ~skeeto/public-inbox@lists.sr.ht In-Reply-To: <20210219015056.ykehuy5vdz2ou3hl@nullprogram.com> References: <20210219015056.ykehuy5vdz2ou3hl@nullprogram.com> <7df03fe8f8d0304f0ed2cd95d7a839ae@codesections.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: daniel@codesections.com Thanks very much for the helpful and through reply! This (along with you= r post) has been very=0Ahelpful in getting my head around all of this, an= d has definitely impacted the design decisions =0AI'm making as I work to= expand the argument parser built in to the Raku standard library.=0A=0A>= > --input-files *.jpg=0A> =0A> This has no way to indicate where the argu= ments stop such that option processing can continue, so=0A> this option m= ust go last. If it must go last, then these are really just positional ar= guments.=0A> [snip]=0A> Arbitrary argument lists should be positional arg= uments. If you need multiple such lists (e.g.=0A> multiple inputs and mul= tiple outputs), all but one list should be relegated to a repeated argume= nts=0A> =E2=80=94 preferably the ones least likely to be used with glob e= xpansion.=0A=0AThat's a very helpful way of putting it, and makes me real= ize that subcommands (in the style of git =0Aand similar commands can als= o be useful. If a CLI needs to be able to accept multiple argument lists= =0Abut _only one in any given invocation_, then it can use a subcommand f= ollowed by positional arguments.=0A(Or, and this is effectively the same = thing, have a boolean option that changes the meaning of the =0Apositiona= l arguments.) That doesn't address the use case of needing to process mu= ltiple lists in the=0Asame invocation, but it at least narrows the scope = of the problem.=0A=0AThanks again!=0ADaniel