Re: [PATCH/RFC] parse-options: add facility to make options configurable
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Mar 25, 2017, 21:28 UTC
- Message-ID
- <20170325212818.2fdxhrywm4zxmmck@genre.crustytoothpaste.net>
- In-Reply-To
- <20170324231013.23346-1-avarab@gmail.com>
On Fri, Mar 24, 2017 at 11:10:13PM +0000, Ævar Arnfjörð Bjarmason wrote:
Show 10 quoted lines
> On Sun, Mar 19, 2017 at 2:43 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote: > > I don't know if this is what Duy has in mind, but the facility I've > > described is purely an internal code reorganization issue. I.e. us > > not having to write custom code for each bultin every time we want to > > take an option from the command line || config. > > Here's an implementation of this I hacked up this evening. This is > very WIP as noted in the commit message / TODO comments, but it works! > I thought I'd send it to the list for comments on the general approach > before taking it much further.
For what it's worth, I think this is a good design. It makes it easy to add options when needed, but it doesn't override the defaults for the entire command, which was my concern.
The potential for removing a decent amount of likely duplicative code also makes me happy.
-- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204