From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2829D436C8; Mon, 11 Dec 2023 10:54:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79E2B40FDE; Mon, 11 Dec 2023 10:54:28 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 3DF5F40ED6 for ; Mon, 11 Dec 2023 10:54:24 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4SpcWJ2c5Rz29fnB; Mon, 11 Dec 2023 17:53:16 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id 15D9314040D; Mon, 11 Dec 2023 17:54:22 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 11 Dec 2023 17:54:21 +0800 From: Chengwen Feng To: , , , CC: Subject: [RFC v3 00/12] add argparse library Date: Mon, 11 Dec 2023 09:50:58 +0000 Message-ID: <20231211095110.18946-1-fengchengwen@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231121122651.7078-1-fengchengwen@huawei.com> References: <20231121122651.7078-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Introduce argparse library (which was inspired by the thread [1]), compared with getopt, it makes it easy to write user-friendly command-like program. Note: the [1/6] commit contains usage examples. [1] https://patchwork.dpdk.org/project/dpdk/patch/20231105054539.22303-2-fengchengwen@huawei.com/ Chengwen Feng (12): eal: introduce more macro for bit definition argparse: add argparse library argparse: support verify argument config test/argparse: add verify argument config test argparse: support parse parameters test/argparse: add parse parameters test argparse: provide parsing known type API test/argparse: add parse type test argparse: support parse unsigned base type test/argparse: add parse unsigned base type test argparse: pretty help info examples/dma: replace getopt with argparse --- v3: refine the implement, standard new marco for bit definition, add reserved field, extend flags to 64bit, support u8/u16/u32/u64, add rte_argparse_parse_type() API, pretty help info, fix dmafwd bug, also address some of Stephen's comments. v2: refine the definition, add implement code, add examples which address Stephen's comments. app/test/meson.build | 1 + app/test/test_argparse.c | 835 +++++++++++++++++++++++++ doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf.in | 1 + doc/guides/prog_guide/argparse_lib.rst | 141 +++++ doc/guides/prog_guide/index.rst | 1 + examples/dma/dmafwd.c | 279 ++++----- examples/dma/meson.build | 2 +- lib/argparse/meson.build | 7 + lib/argparse/rte_argparse.c | 782 +++++++++++++++++++++++ lib/argparse/rte_argparse.h | 218 +++++++ lib/argparse/version.map | 8 + lib/eal/include/rte_bitops.h | 64 ++ lib/meson.build | 1 + 14 files changed, 2187 insertions(+), 154 deletions(-) create mode 100644 app/test/test_argparse.c create mode 100644 doc/guides/prog_guide/argparse_lib.rst create mode 100644 lib/argparse/meson.build create mode 100644 lib/argparse/rte_argparse.c create mode 100644 lib/argparse/rte_argparse.h create mode 100644 lib/argparse/version.map -- 2.17.1