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 A339E45460; Fri, 14 Jun 2024 20:58:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 559AD40B9A; Fri, 14 Jun 2024 20:58:43 +0200 (CEST) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mails.dpdk.org (Postfix) with ESMTP id AF5BC4060B for ; Fri, 14 Jun 2024 20:58:41 +0200 (CEST) Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-52c82bea25fso355103e87.2 for ; Fri, 14 Jun 2024 11:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1718391521; x=1718996321; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=46MVTnR9OErIFsqijbU/pz2qnNe36wCUEY8+hiJZfCo=; b=VQw1pCCSwtP7KTkHgiG5Qn4vjBsJK8xJ0FAio8qhC4CyXAnP8tbt01RM5iedyALIrC NiGWT/T4k6w/RronoigEZ/2NkKnicKZ8GDTdadYJ2oefOc6raF14k3KrKKhZN7x5VAob ibRXEJ4lH1fsZ8bVViq9EFt5Gsu7BbDs8Mqd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718391521; x=1718996321; h=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=46MVTnR9OErIFsqijbU/pz2qnNe36wCUEY8+hiJZfCo=; b=ngRzIDdQHHMie1eeJLJo4A34jT9AD10hW5oBT86s2jxPt5BYkT2AWyW1Xyon5TNzJ+ AVlAn3kNBPjCM0/1tj4P166Zcu1aW+pAs5DIh2X+Jr+HGOQzHjrhnQaObhBHxe3UyN66 zelw+6hINB2LoV2kTxdrY1OWKGXH4KiXkyzAcc2fJvygSi7KcZM5CJMdCZEuJf/1MUnu Rr/bEznYiz6pq42GdFc2J6EyKw9CmkvZnqIlkVlhPUy+oiYb31CpAsxAhRsADGU7v4m5 GlP+xg33kBrFuW1HU1TnY50lsTMAZuT+BUyyg6xKB5jLBxLB0Kw+/5u/hiWO3HwM3doZ o4dQ== X-Forwarded-Encrypted: i=1; AJvYcCV8t9tZi36/GbNEFDA1PPxGH0PYWH9dvi+T5LsVLgKtXIybw3BY5PuzhJBBb0/IHHssDF2kKz6h/k1/jcc= X-Gm-Message-State: AOJu0Yy+QDU9axMTtow6CCtyxJB2OWzu48HqhjIyrX+UPRUoV39sep4z AKTPwK00lyWrE2o1ZQX+htBBLm/G1qOpPEr17Iul5GOZaFo4nMdY/7l3QQGaZU6ZMyic4f8bTP1 Puyo1XR9b13mDc217BhoV5Q+/QtQzuRc+4JF6IA== X-Google-Smtp-Source: AGHT+IEBbIsefIKaJySIkHQxkplC/6vsNWr2PWT40Ck6u64tlMijTv2T1DRBbBgyGp+thA1pDILLtLKj6VYVSjxR60A= X-Received: by 2002:a05:651c:198b:b0:2ec:2f8:f4ae with SMTP id 38308e7fff4ca-2ec0e3df9damr25740421fa.0.1718391521060; Fri, 14 Jun 2024 11:58:41 -0700 (PDT) MIME-Version: 1.0 References: <20240412111136.3470304-1-luca.vizzarro@arm.com> <20240412111136.3470304-3-luca.vizzarro@arm.com> <743fd932-1192-42ac-ab5b-27ac5b7e56ed@arm.com> In-Reply-To: From: Nicholas Pratte Date: Fri, 14 Jun 2024 14:58:29 -0400 Message-ID: Subject: Re: [PATCH 2/5] dts: skip first line of send_command output To: Jeremy Spewock Cc: =?UTF-8?Q?Juraj_Linke=C5=A1?= , Luca Vizzarro , dev@dpdk.org, Paul Szczepanek , Jack Bond-Preston Content-Type: text/plain; charset="UTF-8" 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 > > > >> @@ -132,6 +135,9 @@ def send_command(self, command: str, prompt: str | None = None) -> str: > > > >> self._stdin.flush() > > > >> out: str = "" > > > >> for line in self._stdout: > > > >> + if skip_first_line: > > > >> + skip_first_line = False > > > >> + continue > > > > > > > > Is there ever a reason to distinguish between the first line and the > > > > line with the command on it? > > > > > > As above, not really sure. Would this always be a command prompt? The > > Whether this first line is always the command prompt or not is > specific to the shell unfortunately. In "bash-like" shells where > commands you send are echoed into stdout for easy-of-use for the > developer (like testpmd), this first line will always be the command > you sent to it. It technically isn't always required for this to > happen however, so we could make this assumption, but it could be > slightly more limiting down the line. This is very insightful! This may be a bit naive on my end given that I haven't provided much serious thought on this, but would it be possible to include some kind of conditional statement that asserts something like 'if the user-inputted prompt is in the first line and it is proceeded by testpmd>, then remove the first line,' or something along those lines? I personally can't think of a reason that justifies leaving the command prompt in the output. Although the weight of my input on this is admittedly very light since I don't have a good intuition about this issue.