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 AB78743358; Fri, 17 Nov 2023 20:28:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E659C40285; Fri, 17 Nov 2023 20:28:32 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id BE0B54021E for ; Fri, 17 Nov 2023 20:28:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700249311; 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=t1sByOd9Ykd6CjJqluhr9iReYBuw9czuDjaOCQARQKE=; b=ZAeJAEuIdqNa7lQmIPy7H4MynP0t7WJVSC1L3YMVXmTijL1HH1RuI7O21barunz5QWUQMH MP6RqZaWlzaH/S0YuFG6oxznWyRSpg5AL490vg0s/r/OvSmGY1aY+H//6Nw5cjCBqFjA7E QZLiJbaGnAqWzS4GpeiKvyfu49Zq668= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-j9tcKcFJNBGe5K1AWAxFdA-1; Fri, 17 Nov 2023 14:28:29 -0500 X-MC-Unique: j9tcKcFJNBGe5K1AWAxFdA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 80B27101A529; Fri, 17 Nov 2023 19:28:29 +0000 (UTC) Received: from RHTPC1VM0NT (unknown [10.22.34.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 208582026D4C; Fri, 17 Nov 2023 19:28:29 +0000 (UTC) From: Aaron Conole To: Michael Santana Cc: ci@dpdk.org, David Marchand , Thomas Monjalon , Patrick Robb , Dumitru Ceara Subject: Re: [RFC v2 1/3] pw_mon: improve command line options References: <20231107203158.1261199-1-aconole@redhat.com> <20231107203158.1261199-2-aconole@redhat.com> Date: Fri, 17 Nov 2023 14:28:28 -0500 In-Reply-To: (Michael Santana's message of "Fri, 17 Nov 2023 11:26:19 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org Michael Santana writes: > On Tue, Nov 7, 2023 at 3:32=E2=80=AFPM Aaron Conole = wrote: >> >> In the future, we'll use this to add support for passing opts into some = parts >> of pw_mon. >> >> Signed-off-by: Aaron Conole > Acked-by: Michael Santana Thanks >> --- >> pw_mon | 65 +++++++++++++++++++++++++++++++++++++++++++++------------- >> 1 file changed, 51 insertions(+), 14 deletions(-) >> >> diff --git a/pw_mon b/pw_mon >> index 28feb8b..da4b9a9 100755 >> --- a/pw_mon >> +++ b/pw_mon >> @@ -21,34 +21,71 @@ >> >> [ -f "${HOME}/.pwmon-rc" ] && source "${HOME}/.pwmon-rc" >> >> -if [ "$1" !=3D "" ]; then >> - pw_project=3D"$1" >> - shift >> +if [ "$1" !=3D "" ]; then >> + if ! echo "$1" | grep -q -s -E ^-- ; then > The missing quotes give me OCD, but I'll let it pass :) > > It is technically correct apparently. It worked when I tested it. I > guess I am so used to using grep with quotes that I had never > considered that there was a whole world where people use grep without > quotes :P > >> + pw_project=3D"$1" >> + shift >> + fi >> fi >> >> if [ "$1" !=3D "" ]; then >> - pw_instance=3D"$1" >> - shift >> -fi >> - >> -if [ "X$pw_instance" =3D=3D "X" -o "X$pw_project" =3D=3D "X" ]; then >> - echo "ERROR: Patchwork instance and project are unset." >> - echo "Please setup ${HOME}/.pwmon-rc and set pw_project " >> - echo "(or pass it as an argument)." >> - echo "Also either setup pw_instance or pass it as an argument." >> - exit 1 >> + if ! echo "$1" | grep -q -s -E ^-- ; then >> + pw_instance=3D"$1" >> + shift >> + fi >> fi >> >> userpw=3D"" >> >> if [ "$1" !=3D "" ]; then >> - pw_credential=3D"$1" >> + if ! echo "$1" | grep -q -s -E ^-- ; then >> + pw_credential=3D"$1" >> + shift >> + fi >> fi >> >> + >> +while [ "$1" !=3D "" ]; do >> + if echo "$1" | grep -q -s -E ^--pw-project=3D ; then >> + pw_project=3D$(echo "$1" | sed s/^--pw-project=3D//) >> + shift >> + elif echo "$1" | grep -q -s -E ^--pw-instance=3D ; then >> + pw_instance=3D$(echo "$1" | sed s/^--pw-instance=3D//) >> + shift >> + elif echo "$1" | grep -q -s -E ^--pw-credentials=3D ; then >> + pw_credential=3D$(echo "$1" | sed s/^--pw-credentials=3D//) >> + shift >> + elif echo "$1" | grep -E ^--help >/dev/null 2>&1; then >> + echo "patchwork monitor script" >> + echo "$0: args" >> + echo "Required if not set in ~/.pwmon-rc file:" >> + echo " proj|--pw-project=3D Project name" >> + echo " instance|--pw-instance=3D URL for pw" >> + echo "" >> + echo "Options:" >> + echo " --pw-credentials=3Du:p Sets user / password f= or web client" >> + echo " --add-filter-recheck=3Dfilter Adds a filter to flag = that a recheck needs to be done" >> + echo "" >> + exit 0 >> + else >> + echo "Unknown option: '$1'" >> + echo "Rerun with --help for details" >> + exit 1 >> + fi >> +done >> + >> if [ "X$pw_credential" !=3D "X" ]; then >> userpw=3D"-u \"${pw_credential}\"" >> fi >> >> +if [ "X$pw_instance" =3D=3D "X" -o "X$pw_project" =3D=3D "X" ]; then >> + echo "ERROR: Patchwork instance and project are unset." >> + echo "Please setup ${HOME}/.pwmon-rc and set pw_project " >> + echo "(or pass it as an argument)." >> + echo "Also either setup pw_instance or pass it as an argument." >> + exit 1 >> +fi >> + >> source $(dirname $0)/series_db_lib.sh >> >> function emit_series() { >> -- >> 2.41.0 >>