From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 3B4A45A026F; Mon, 5 Jun 2023 07:19:50 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v2] conf, log: On -h / --help, print usage to stdout, not stderr Date: Mon, 5 Jun 2023 07:19:50 +0200 Message-Id: <20230605051950.685102-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: QWQ5566TOX3T2WEO3KNKG7OMEPYS4KZY X-Message-ID-Hash: QWQ5566TOX3T2WEO3KNKG7OMEPYS4KZY X-MailFrom: sbrivio@passt.top 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: =?UTF-8?q?Erik=20Sj=C3=B6lund?= , David Gibson X-Mailman-Version: 3.3.8 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: RXJpayBzdWdnZXN0cyB0aGF0IHRoaXMgbWFrZXMgaXQgZWFzaWVyIHRvIGdyZXAgZm9yIG9wdGlv bnMsIGFuZCB3aXRoDQotLWhlbHAgd2UncmUgYW55d2F5IHByaW50aW5nIHVzYWdlIGluZm9ybWF0 aW9uIGFzIGV4cGVjdGVkLCBub3QgYXMNCnBhcnQgb2YgYW4gZXJyb3IgcmVwb3J0Lg0KDQpXaGls ZSBhdCBpdDogb24gLWgsIHdlIHNob3VsZCBleGl0IHdpdGggMC4NCg0KUmVwb3J0ZWQtYnk6IEVy aWsgU2rDtmx1bmQgPGVyaWsuc2pvbHVuZEBnbWFpbC5jb20+DQpMaW5rOiBodHRwczovL2J1Z3Mu cGFzc3QudG9wL3Nob3dfYnVnLmNnaT9pZD01Mg0KTGluazogaHR0cH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