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 C3727439B7; Wed, 24 Jan 2024 16:55:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ADBE240E72; Wed, 24 Jan 2024 16:55:01 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id E4B4C40E0F for ; Wed, 24 Jan 2024 16:54:59 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1d75ea3a9b6so26561665ad.2 for ; Wed, 24 Jan 2024 07:54:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1706111699; x=1706716499; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=zaKmbBPBXPwyjdDpyhgWjAGOONY//WD7dfNcm8ZKoVk=; b=H4lYg46imIyMZwwyVuubJsKpOzhKPRaBqIpWEAnTVjO/nwaHCOgLSLMSXgKK2aaigO sOiCnIEioKgCDzUUL1rjJ8ortHvZD/TdKHX5mxhn7BHySzDoboMvhsVh4Dm4BVa0A/UC EQ4Ajky5elmr6iH6h9ngKcgtUW9Ehz1lB9dvvIpnve4tAR/PCXZhIJKJPEuLzqOxGnti 1X7Yn4+40bm0zmGgpwA6yaROSD1/sX5NiTC3k1D67b1bdnk4rrN8KEGlTm3exYiSai4f WABGkQKBQHkiE2K120HlcDpY64iEPw1WUmtgUa/4YFbZSP+sygPbr/A3kNSCZOv6e4/Z LnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706111699; x=1706716499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zaKmbBPBXPwyjdDpyhgWjAGOONY//WD7dfNcm8ZKoVk=; b=cEsXPhoaEZUsf/QKuV0hMCEOAa03XAGElKt8NtHV9QaOCWk95vR0DnPfQgeaBVr+uy gzcsZ5WtNkbpX+OmELMXMKai7BwN4Xv6HzW+u3To18L3texVrw4ISOfhrhBAnv1ymugL qtKgbaCHmCX8ksMYm6PBgreFfx2p60rbMznJC/EcG+wDwYEkDNWuh20+HVH4WTYnnL8N 0Bb0T5wA1uNeEtZWdQbcnkHmZwpstn5M5StaPk+ltnVXBKwMf8gM81x9+7nH1l7meacs WG/b5D4KhAEgTOeLadT0pmYu0WtB8PHxPpg3ixfFxX2X9Kb9dLtoG3L2US6+Slhnj+FO X1EA== X-Gm-Message-State: AOJu0Yz/sAOUp49MdiVk1QbTeXabD08CXDSnngT14h0Qj920buOvqguI LCdbprr0A78eGvM6zyNruHdhH1uY7LXBT0YuKgW8xtmDO3NMMcAQbVYyVwSKGV4= X-Google-Smtp-Source: AGHT+IGna62WtD3jdGKDhmk91PEH5k7xXFC12bQFf7hOTqvzhEDUfC7YZ0r4uFD8xFaBUbtN1jYknw== X-Received: by 2002:a17:902:c20d:b0:1d6:fbab:d40b with SMTP id 13-20020a170902c20d00b001d6fbabd40bmr1060605pll.85.1706111698957; Wed, 24 Jan 2024 07:54:58 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id 13-20020a170902c24d00b001d76f1fa24dsm2840793plg.46.2024.01.24.07.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 07:54:58 -0800 (PST) Date: Wed, 24 Jan 2024 07:54:57 -0800 From: Stephen Hemminger To: Chengwen Feng Cc: , , Subject: Re: [24.03 RFC] argparse: add argparse library Message-ID: <20240124075457.0a52c8b1@hermes.local> In-Reply-To: <20231121122651.7078-1-fengchengwen@huawei.com> References: <20231121122651.7078-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Tue, 21 Nov 2023 12:26:51 +0000 Chengwen Feng wrote: > Introduce argparse library (which was inspired by the thread [1]), > compared with getopt, the argparse has following advantages: > 1) Set the help information when defining parameters. > 2) Support positional parameters. > > The parameters parsing according following: > 1) positional: use callback to parse (passed the long-name as the key > for callback). > 2) optional: > In addition to callback to parse, but also support: > 2.1) no-val: support set default value to saver. > 2.2) has-val: support set value to saver, the value must be conform > RTE_ARGPARSE_ARG_VAL_xxx. > 2.3) opt-val: if current without value then treat as no-val, else could > treat as has-val. How compatiable is this with Python or other implementations of argparse in C?