Re: [PATCH 1/2] btrfs-progs: Make option parsing more robust to code modifications

2015-01-28 Thread Hugo Mills
On Wed, Jan 28, 2015 at 09:15:42AM +0800, Qu Wenruo wrote: Original Message Subject: [PATCH 1/2] btrfs-progs: Make option parsing more robust to code modifications From: Hugo Mills h...@carfax.org.uk To: linux-btrfs@vger.kernel.org, dste...@suse.cz Date: 2015年01月27日 23:05

Re: [PATCH 1/2] btrfs-progs: Make option parsing more robust to code modifications

2015-01-27 Thread Qu Wenruo
Original Message Subject: [PATCH 1/2] btrfs-progs: Make option parsing more robust to code modifications From: Hugo Mills h...@carfax.org.uk To: linux-btrfs@vger.kernel.org, dste...@suse.cz Date: 2015年01月27日 23:05 The current approach to option parsing, where long-only

[PATCH 1/2] btrfs-progs: Make option parsing more robust to code modifications

2015-01-27 Thread Hugo Mills
The current approach to option parsing, where long-only options are selected on the basis of their position in the long_options array is fragile and painful to modify if options are to be inserted into the list, rather than appended. Instead, use the last field of struct option to return a value

Re: [PATCH 1/2] btrfs-progs: Make option parsing more robust to code modifications

2015-01-27 Thread David Sterba
On Tue, Jan 27, 2015 at 03:05:52PM +, Hugo Mills wrote: The current approach to option parsing, where long-only options are selected on the basis of their position in the long_options array is fragile and painful to modify if options are to be inserted into the list, rather than appended.