From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 1E2225A005E for ; Thu, 9 Feb 2023 18:45:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675964753; 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=9ZXZ44/tbDhqgNz7ijZYlStYQIIXFuCcMRU0jD6sdgo=; b=aCHe4MBCxU7HIYLtsg5LcIzdcldpJFypvOj9HQDCzg3OyaM2LOS/WjC8pfEVsr1o6fdMj5 YmJIISz3mrlT7z1V4/fFxnfOzpH59uyY2qnfs0nOCpNFWjsu+9MDrvX1NmjAm32fwBbdfb 7vTQlISREjN3cPk+MsGCIOfJA1rUpnU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-481-1sIWTiitPjy9flLL1Y-T7A-1; Thu, 09 Feb 2023 12:45:51 -0500 X-MC-Unique: 1sIWTiitPjy9flLL1Y-T7A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6BC611818E6B; Thu, 9 Feb 2023 17:45:51 +0000 (UTC) Received: from maya.cloud.tilaa.com (ovpn-208-4.brq.redhat.com [10.40.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 325AD51FF; Thu, 9 Feb 2023 17:45:51 +0000 (UTC) Date: Thu, 9 Feb 2023 18:45:48 +0100 From: Stefano Brivio To: Laine Stump Subject: Re: [PATCH v2 8/9] log a detailed error (not usage()) when there are extra non-option arguments Message-ID: <20230209184548.4f3cc4f2@elisabeth> In-Reply-To: <20230208174838.1680517-9-laine@redhat.com> References: <20230208174838.1680517-1-laine@redhat.com> <20230208174838.1680517-9-laine@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: FOCBCIIWAQ7MBWCH3YA7LLZKYJM6OBT6 X-Message-ID-Hash: FOCBCIIWAQ7MBWCH3YA7LLZKYJM6OBT6 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, laine@laine.org X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 8 Feb 2023 12:48:37 -0500 Laine Stump wrote: > Telling the user "this bit is wrong" is more useful than telling them > "these are all the potential things that would be right; actual error > identification is left as an exercise for the reader". Ah, yes, I guess. :) > > Signed-off-by: Laine Stump > --- > conf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/conf.c b/conf.c > index 1bfbc55..ce4e3e5 100644 > --- a/conf.c > +++ b/conf.c > @@ -1539,7 +1539,7 @@ void conf(struct ctx *c, int argc, char **argv) > if (c->mode == MODE_PASTA) > conf_pasta_ns(&netns_only, userns, netns, optind, argc, argv); > else if (optind != argc) > - usage(argv[0]); > + errexit("Extra non-option argument: %s", argv[optind]); > > isolate_user(uid, gid, !netns_only, userns, c->mode); > -- Stefano