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 5739243199; Wed, 18 Oct 2023 13:22:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0CD1402D9; Wed, 18 Oct 2023 13:22:06 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id AE80540261 for ; Wed, 18 Oct 2023 13:22:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697628125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nEMHM4s2I6A74VctVM6yNocCsLS2UKDypcEGlkB/TOg=; b=J3BMpbMEpXnfSPQR2Z7w+nkCzlcqxQpXL8gf5VX30ryBgyOg2rSsYQ8WxYtE30dk4x0s6I nMqBM03XBOA0ne2mGnQQzai3/tl3eFi+irFicT2UFE6KE2lHqH9mlBJeYsTPvqLD7z0pzT 1iXbhynUG7lgb3T59qy9xn48g/tAnLg= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-413-Tr_V7-VmP1GWVYG5TjbjoA-1; Wed, 18 Oct 2023 07:21:53 -0400 X-MC-Unique: Tr_V7-VmP1GWVYG5TjbjoA-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2c512a53e82so39526751fa.0 for ; Wed, 18 Oct 2023 04:21:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697628112; x=1698232912; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nEMHM4s2I6A74VctVM6yNocCsLS2UKDypcEGlkB/TOg=; b=Pa4e1tjhMDxD2lqy3TKz0H8tj/t2Y6Bno/jm6/Mom3UKK0R1gi2LBpCbX/23kB2x2i 2ftu504paAe5Vp9RfLoZZMx1cUHLUkOemnyWYM29pzeBVtNXDwvpqdHIa9H4PPVNyKcJ A1oLQEOEr6zcgQLDoPfg2E33TxP2SCiuXRX6tIPM5qfzFsJTvRwnuRFMRqQLH3qaqp2W YVZ6mLQIJRkmUqioE5h5zjGuCLhkiqvaewkL9ZgfUqp3q4U53tjFfPp3ggvX/KVpZj9V mBRwzjCXaP2NM4NlEwUaKDhLlxZ/O6O3e0KrPxzmJMAxllLlNcJW2ZnaIcZWKVV9JQfS SDBQ== X-Gm-Message-State: AOJu0YxZZ1SUuESIQpK9tHGDOD0IXX8j6Fnw1hYIcOt4PfrtIy19gIPC Wonc1Q8dAK9qVRAYujHiqUQfKqHmf5kjr/yKen+G2rjCmkMpR6rSmgKFQpZt9mljtYvuW97l1Bt 5mNpI1STDvx1baLevF58= X-Received: by 2002:a2e:a585:0:b0:2c5:169f:ff03 with SMTP id m5-20020a2ea585000000b002c5169fff03mr4162080ljp.5.1697628112284; Wed, 18 Oct 2023 04:21:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdn8LFL5u9hfzWERNtxIHdFf9tD9f5Vab0O0ORk2HvIOIQzi0amc+pzKbgRw+tAM14Ej11mcFAWF5+Ziec8fk= X-Received: by 2002:a2e:a585:0:b0:2c5:169f:ff03 with SMTP id m5-20020a2ea585000000b002c5169fff03mr4162067ljp.5.1697628111966; Wed, 18 Oct 2023 04:21:51 -0700 (PDT) MIME-Version: 1.0 References: <20230802170052.955323-1-bruce.richardson@intel.com> <20231016140612.664853-1-bruce.richardson@intel.com> In-Reply-To: From: David Marchand Date: Wed, 18 Oct 2023 13:21:40 +0200 Message-ID: Subject: Re: [PATCH v4 0/7] document and simplify use of cmdline To: Bruce Richardson Cc: dev@dpdk.org, rjarry@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hello Bruce, On Tue, Oct 17, 2023 at 7:08=E2=80=AFPM Bruce Richardson wrote: > > > sure I like it that much as a feature :-) I rather like having unique > > > prefixes for each command. I wasn't actually aware of the testpmd "he= lp > > >
" command at all. I will have to look into it. > > > > Let me propose an alternative hack. > > I mentionned previously that we could have a better namespace / > > discriminant for those symbols, and it seems easier than I thought: > > > > @@ -25,8 +25,10 @@ def process_command(tokens, cfile, comment): > > sys.exit(1) > > for t in tokens: > > if t.startswith('<'): > > - break > > - name.append(t) > > + t_type, t_name =3D t[1:].split('>') > > + name.append(t_name) > > + else: > > + name.append(t) > > name =3D '_'.join(name) > > > > result_struct =3D [] > > > > With this, any command implementation symbol has the full chain of > > token names as a prefix which will ensure there is no conflict. > > WDYT? > > > Having thought a little more about it, I still don't like having the full > command in all cases, but I can see it being useful for cases of > overlapping prefixes. > > How about making it optional - setting a flag in the typename, or in the > parameter name to indicate that it should be included in the overall > command name. For example, if we prefix the variable name with "_" or "__= ", > it could indicate that we can choose to include this. > > show port n --> void cmd_show_port_parsed(...) > show port _n --> void cmd_show_port_n_parsed(...) > I think I get what you mean, and it seems acceptable. > Prefixes on strings beyond initial tokens could just be silently stripped= . By initial tokens, do you mean fixed strings token before a <> typed token = ? --=20 David Marchand