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 948174365D; Mon, 4 Dec 2023 08:54:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E506A40685; Mon, 4 Dec 2023 08:54:00 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 290BB4067B for ; Mon, 4 Dec 2023 08:53:59 +0100 (CET) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SkG6V4KK0zsRmq; Mon, 4 Dec 2023 15:50:10 +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, 4 Dec 2023 15:53:55 +0800 From: Chengwen Feng To: , , , CC: Subject: [RFC v2 0/6] add argparse library Date: Mon, 4 Dec 2023 07:50:42 +0000 Message-ID: <20231204075048.894-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: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 (6): 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 examples/dma: replace getopt with argparse --- v2: refine the definition, add implement code, add examples which address Stephen's comments. app/test/meson.build | 1 + app/test/test_argparse.c | 764 +++++++++++++++++++++++++ doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf.in | 1 + doc/guides/prog_guide/argparse_lib.rst | 142 +++++ doc/guides/prog_guide/index.rst | 1 + examples/dma/dmafwd.c | 288 +++++----- examples/dma/meson.build | 2 +- lib/argparse/meson.build | 7 + lib/argparse/rte_argparse.c | 611 ++++++++++++++++++++ lib/argparse/rte_argparse.h | 179 ++++++ lib/argparse/version.map | 7 + lib/meson.build | 1 + 13 files changed, 1846 insertions(+), 159 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