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 785A242FC4; Thu, 3 Aug 2023 10:11:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68B944282D; Thu, 3 Aug 2023 10:11:42 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id A6AF94161A for ; Thu, 3 Aug 2023 10:11:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691050300; x=1722586300; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=nrWmAaPFoaouljaEGwtzvvmOMiJVmq6y8GGUlmWcgw4=; b=hEiO5c5NZRGHIDnKXA+hSHXCwu/8kmNiZSki7MrNQnEbvhAlSNK/ws39 6w2BsmufCl5CSGxFafEzLqvNbD5uYaht2M3qXFZ9UxIe+BXABN+GIkjQk 3jSLWCN1QnmE4Nl6JH4ADM5J+5GPTCovqaZ212eK7vu/3Xp276lMcWQge A5SAa0ApxCFrLDQVYY3ZHq6dPj1+KX7IYRZEtBvW//7bYi2chtT8Ym/bq Se1DBSDCcUEUGvzu55Bwr5AiMIOaOX9ukG7LRR3M7MW/5xhRG5g9pqJmF D4sXqfhWSoL5MmDUJb31L0j9PqeRizMoTHcdJ4gU2azDtQIyKAtEaj4XC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="354716393" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="354716393" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 01:11:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="1060154951" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="1060154951" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga005.fm.intel.com with ESMTP; 03 Aug 2023 01:11:39 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 3 Aug 2023 01:11:39 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Thu, 3 Aug 2023 01:11:39 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 3 Aug 2023 01:11:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rn8I8tK9yZ6/x9gsz4jPYn5zO5E6xs2Gm5d5tcSPLAXiimO82o3V8UBaGwnK05mSlf07B/mtoOV74Hsnp1F9IuACuJJf9Ov3beELpjP+6Stvapfggzy3ln9mM6myUrmzgiS3V5sigtzQs5qleN765eqCOb6oHWrQFJ9wGyZP7T9gchK3zVHDWYo65zX+DGySR/VHpl9w2oF/NG0aWa+0oLHzklphgkr/CkZXLAIZydWdXpJMU4mSRi46HwOth/9lISjF033dAp6zNiG7K+IQuUTwfIXAIUcyo83/nAJRICydUYWymuSwg7Ztk2q3SiUUqiyhw1MP6aJ6fLKbMfLqfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1DogU9to7n6tOhkUK1lLS5mTTRJXDxqqALJv/3tzMuA=; b=OglmThCxLoj62gMN7tns0z4vvbcxL/3HoiBmEt6r4pVn4d6ET94pVz9c/jkXvlfwdOBT4YrW/FZhEM+piqPV8jUqhzEHGv3JJpRM+7UaTaH/rq7BXdOPCcmCyi0TRtBsQXsqiX2OwlJf98jhB58yPh5ecIwb7+W0pu569I0t3DoT3sg1p3bwyR2u1QezDrVldsUJcTnYw9raImelwijLoOm7GNwiUm1lszEpZwC4SqlxlSmKqMNTqHCZfEdSifWSTj7G8vhESgH0j5rytvS3UZ3DN5NxedFfQB+jsWgvW1U24wuIX0LwX3lrP+muTbUR5zq1NTf10fehAXpbFKLxjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DM8PR11MB5670.namprd11.prod.outlook.com (2603:10b6:8:37::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Thu, 3 Aug 2023 08:11:37 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::9802:65f0:c441:780f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::9802:65f0:c441:780f%7]) with mapi id 15.20.6631.046; Thu, 3 Aug 2023 08:11:37 +0000 Date: Thu, 3 Aug 2023 09:11:31 +0100 From: Bruce Richardson To: Stephen Hemminger CC: , Olivier Matz Subject: Re: [RFC PATCH 0/1] make cmdline library easier to use Message-ID: References: <20230802170052.955323-1-bruce.richardson@intel.com> <20230802110507.483a6b4d@hermes.local> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230802110507.483a6b4d@hermes.local> X-ClientProxiedBy: DB7PR02CA0011.eurprd02.prod.outlook.com (2603:10a6:10:52::24) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DM8PR11MB5670:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c7a1a9a-450d-46e4-1afb-08db93f941e8 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cRyVIhsG4vj6d9T9BkiXAy0h4Q37H3tBJy5N94FxQo64DP7I1piX2lORduio1fKW7VHnO1z30Z+OSfsD6OZF6n1lNZJGF8J82VS2AdGN+PFvP0QFWl4NiAa1+QAMYJSV010LCM4Awy2UBcLCF9gCe3QxXkMc7JL47P1Z5iXpOrGWIzzaXPrpWSBrCj9+0aSLN6GJbHL4bb0WZcky3Y2SGddCQpUFF5gwIiSTB4C9M33EiUIc2SHu+zLNfSOwwc4rDiF3MdqgCkZb6521Jntuox6HiXvcuy9O8kIBHjKR5qpoiFR/+NtUviq0fLT/z19nl93a89a+tb30QjZJ8/fzGtoSkIjwI6w0s9ofSp6U/afDqDJrFy4Ttd6eWGFwXmK3TMlCKhHuoD+XRly9WBtQLkvDHvEiH9YCq1tiTKLfHwAqdpR0ZmUZvpjI1JkW2IUgiu4ayVcBoNLszAyHJM2aJmh3kQBa+KEncbshlKzjwOSw/Dk/C2uwIGiJBfu4O8xkLFkdRoKgQWp1xuZ5ZjN279IvvAZEdB9z8qR+MDMP0v1iVBkwY+qx7HMStXdWd86R X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(366004)(39860400002)(346002)(396003)(136003)(451199021)(86362001)(478600001)(38100700002)(82960400001)(6506007)(186003)(26005)(83380400001)(8676002)(8936002)(6666004)(44832011)(41300700001)(6512007)(6486002)(6916009)(316002)(66476007)(66556008)(5660300002)(4326008)(66946007)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?aW4pSXZy1v/LJfIYnnjdoauXXelsZLTSNliql/8UeiIX/19ds37W4H0rkpxz?= =?us-ascii?Q?qWjr6MfgI3MlE23+QpvlXHSPwmPMWnJrItjSGI7GNALiQj/hqtuZrMM8bFDA?= =?us-ascii?Q?QWOcSZ9Ukcl1/vGRO+l2GLDrfeU5Q+vl9sJqHDwAii9Vfff/68qA9jz4lST6?= =?us-ascii?Q?mtGBR3xWVXhNC2IayJNEOyJfXYbnL3N8vu6a4iB+s3ZcNF17tcOIwLiBKaGs?= =?us-ascii?Q?fnfsjVL/x/Zs3L1m/wMRLrV3qAzch0cbAe1AzfOk+zvffe7de0Ys7DlgsX/P?= =?us-ascii?Q?7bFSbA0Qe053ZVtmakW34Q7MAlfaAC3ijaPgOGDX0grF4Xce0ZgwvQ3SgUj2?= =?us-ascii?Q?w8jhgT7eXYjnTZg18grpHw/wGBEfaoi9489w/P0rw2W+LsYFUcnWFFfhrDzc?= =?us-ascii?Q?DTvgUOC3hvAp4GKCCCKTlVypsaiZEEkrky3GRcQrWwGLiPGSh0n6OahX9H7u?= =?us-ascii?Q?UOqZU+gN8YWqR1SNr/o4TIBJjSmFmKFIvN3BOkNftEUVIV9QHpAviLgN9UhI?= =?us-ascii?Q?FKDPmBCVgYTngzhN1wirwwY24+WnkDBi7xVvBIuW6+G7mlbMgJVGu8B2ymr7?= =?us-ascii?Q?2KXrRQSqIKPoAfgQ67K1+uaFmrY7WRZf7iy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NjZVYeeQrbjksC+Dsoepw7LvXb/dkv309R3hJS/j/ebTRt/nB/fVgNb2LNtm?= =?us-ascii?Q?HR0Y+FFyqo8yTgXQFbqrIDMzLw441L2s0Ew7qIvv45RfMCusF/x+nD/VnCl2?= =?us-ascii?Q?pQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 4c7a1a9a-450d-46e4-1afb-08db93f941e8 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2023 08:11:37.1124 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rBN5fqC6y1OuLMvQDo7pu1tfIZ0F0HVgAMNrqvHH3l+0BAhmm3RuGAwPvjnGdSmUfilXG5rfuzFp2BoL0sgmPj0Ys3COQd2MV5HSbEaa+UM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5670 X-OriginatorOrg: intel.com 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 Wed, Aug 02, 2023 at 11:05:07AM -0700, Stephen Hemminger wrote: > On Wed, 2 Aug 2023 18:00:51 +0100 > Bruce Richardson wrote: > > > And now for something completely different... :-) > > > > While it's nice that DPDK includes a commandline library for easily > > adding interactivity to applications, the library itself is a little > > clunky to use, due to the massive amounts of boilerplate definitions > > required. Having used it recently on an app I was playing with for > > testing, I decided the situation can potentially be improved with it > > by use of a script to produce the boilerplate when given a simple > > list of commands the user wants to add to the app. > > > > This is the result of that effort. Sending it here as a rough-draft to > > get feedback on whether this is worth including in DPDK itself. > > Hopefully others may find it of use. > > > > Bruce Richardson (1): > > cmdline/dpdk-cmdline-gen: generate boilerplate for simple cmds > > > > lib/cmdline/dpdk-cmdline-gen.py | 143 ++++++++++++++++++++++++++++++++ > > 1 file changed, 143 insertions(+) > > create mode 100755 lib/cmdline/dpdk-cmdline-gen.py > > Ok, but this surely is a solved problem is some other open source library. > Or does every project reinvent this parsing? > > Seems to me that something like bison/flex (ie yacc/lex) would be better > in terms of expressing the syntax separate from the implementation. Sure, but it has been many, many years since I last even looked at those tools, so it was faster for me to just use this python script for quick cmdline generation when prototyping things! :-) I wanted something that worked for me, so I'm just sharing it with the community in case others find it useful. If you have time, please do indeed come up with a lex/yacc generator instead, it would indeed be a better solution. [If not, I suggest we take what we can get if it works! :-)] /Bruce