From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iwQbD-0006N9-1R for barebox@lists.infradead.org; Tue, 28 Jan 2020 13:08:13 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 28 Jan 2020 14:08:00 +0100 Message-Id: <20200128130801.24890-3-u.kleine-koenig@pengutronix.de> In-Reply-To: <20200128130801.24890-1-u.kleine-koenig@pengutronix.de> References: <20200128130801.24890-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 2/3] commands/test: Improve option parsing to handle "]" less special To: barebox@lists.infradead.org VGVzdGluZyBmb3IgKmFwWzFdICE9ICddJyBpcyBib2d1cyBkdXJpbmcgb3B0aW9uIHByb2Nlc3Np bmcuIEluc3RlYWQKdGVzdCBpZiB0aGVyZSBhcmUgb3B0aW9ucyBsZWZ0IHRvIGJlIHByb2Nlc3Nl ZC4KClRoaXMgZml4ZXMgdGhlIHJldHVybiB2YWx1ZSBmb3IgZS5nLgoKCXRlc3QgLXogJ11sYWxh JwoKU2lnbmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5n dXRyb25peC5kZT4KLS0tCiBjb21tYW5kcy90ZXN0LmMgfCAxMyArKysrKysrKy0tLS0tCiAxIGZp bGUgY2hhbmdlZCwgOCBpbnNlcnRpb25zKCspLCA1IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBh L2NvbW1hbmRzL3Rlc3QuYyBiL2NvbW1hbmRzL3Rlc3QuYwppbmRleCBhYjE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