From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 251125A026D for ; Thu, 16 Feb 2023 06:43:23 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4PHP4K5nRHz4x89; Thu, 16 Feb 2023 16:43:13 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1676526193; bh=Z4H+6xdB+d/1b8mqD7NsYhQLH2zBHW26bYbz1dORsJM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MZMrbpTk+M4x8B2F7QAmpJf62Y8hbh4aVmOFbS+7oOABh5YFCP/cJJENPLiAUfx2h jiDVW1zQeB6FWBQ9iWKOKIAWJ9814IZJPYC3goHDhFiB/oV92a85iltrEiSDdRFA8l P3iPf8UJtsksLRgN/7M0GqhI4EBpTLN/ubz74uQE= Date: Thu, 16 Feb 2023 16:34:17 +1100 From: David Gibson To: Laine Stump Subject: Re: [PATCH v4 3/9] eliminate most calls to usage() in conf() Message-ID: References: <20230215082437.110151-1-laine@redhat.com> <20230215082437.110151-4-laine@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qn5mZSmeWEjS9yCp" Content-Disposition: inline In-Reply-To: <20230215082437.110151-4-laine@redhat.com> Message-ID-Hash: 76BXZZENTFTRHKLYS3JWCO5H66W54RCO X-Message-ID-Hash: 76BXZZENTFTRHKLYS3JWCO5H66W54RCO X-MailFrom: dgibson@gandalf.ozlabs.org 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 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: --qn5mZSmeWEjS9yCp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 15, 2023 at 03:24:31AM -0500, Laine Stump wrote: > Nearly all of the calls to usage() in conf() occur immediately after > logging a more detailed error message, and the fact that these errors > are occuring indicates that the user has already seen the passt usage > message (or read the manpage). Spamming the logfile with the complete > contents of the usage message serves only to obscure the more detailed > error message. The only time when the full usage message should be output > is if the user explicitly asks for it with -h (or its synonyms) >=20 > As a start to eliminating the excessive calls to usage(), this patch > replaces most calls to err() followed by usage() with a call to die() > instead. A few other usage() calls remain, but their removal involves > bit more nuance that should be properly explained in separate commit > messages. >=20 > Signed-off-by: Laine Stump Reviewed-by: David Gibson --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --qn5mZSmeWEjS9yCp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmPtwFIACgkQzQJF27ox 2Gf+Cw//Zcgmq3tVXd6/NF96aHMVMnURZx3QU45pC/PRKbfbcXJwVQjg8eFWff/l o63UrhLCsspeEc+ggXYOCwnuOOKAm8s10NY0B/+zdDws1qmQyVtkS43omkG5LYmh d4STBU2P8oLRktMkGunkPQKJ1mZ21cV15ZArDaw1m9vQdmjfIosqgmqaVpZO2UJJ 0ecNsoLGxo09pK8xMcNkr8S0hKFWghRmhMbvtIJ1cXrvrbCc3PkijC5qv6zeSkwm ykUM1yOKqm8a8ELlnhoAV2+WeHj7Qhie1rcIFT3A6hy3LlasWkIJzIAd2pwIteym KS+ooB7JC8Sqwv8B2NHAt9YzH0svc3dmlBk9Y1NKMl9Bn62nXppXZxmw5zzJlG2I 42fgfkdesE8Qrj8RSWxI6yKli2hbdOOdQi91nsKrhippSKIK531d15hlQs9FeZhz pJkMkgCjUWLPz4NTCCefds6SgxbHJ6/bxPhy/KMPE6WkS5e0WC7IvmtK8F6izbmA byfFuy11PF7A0B3d7JdJ4I6Roh1/E+9aUsAILwVB4hQVcNrxqh4YcTvVvZesqr8v tiTNVRIIYOnZrV8MKjl27mQL+/O0cbsaHqIglLYLu+0ekztd2yu3lSm7EWitSZNl pv/GTq9ulN+VZ9pdHfNa3HvSDaZuzzouldbUq/LPlddhBKfG04U= =D/UO -----END PGP SIGNATURE----- --qn5mZSmeWEjS9yCp--