From patchwork Thu Oct 3 06:35:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1171090 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lespocky.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SMdgitUu"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46kNYy0lDtz9sDB for ; Thu, 3 Oct 2019 16:36:06 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ubgJdqe1zRgsRyzI//AIHGMJcI4VuWMUFKkOr+n2e9E=; b=SMdgitUuyFPWYk SRvJ0izm9V9a1JQusNkpw8n7SJM0ZW7N6+F9d99CEAWSAybo3jCCrk7zjZI6mP149Sd3/dgbIvk4y 0dp+iLlbMP4omW/wXkE4SU35k5vaLB0UNh1vaU6qizUvC/hYekCXnSl44hVjYQnvX2F/0WqfWq4WO CePAAFsRNDOEez/CNvkBKErvlXTe/Ue9m+E/vurI49KFMJF7ueHqewMSj4/SgqrcPxlMD6G5kqSJ/ rvbZj87/YPn5gfLQ4Jmrc9EF7wRr24F2Q6auS+7Psd1I8XMUOgACMbmjS8JbnFo7xuegWYF4zZoB4 q45FHAMusdTu+I9UiWOw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFuiX-0000Jf-MB; Thu, 03 Oct 2019 06:36:01 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFuiE-0008Ma-V8 for linux-mtd@lists.infradead.org; Thu, 03 Oct 2019 06:35:44 +0000 Received: from methusalix.home.lespocky.de ([92.117.58.69]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M7s1M-1iC2pQ1gxe-0051Ln; Thu, 03 Oct 2019 08:35:26 +0200 Received: from lemmy.home.lespocky.de ([192.168.243.176]) by methusalix.home.lespocky.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1iFuhv-0002o9-4q; Thu, 03 Oct 2019 08:35:24 +0200 Received: (nullmailer pid 18482 invoked by uid 2001); Thu, 03 Oct 2019 06:35:20 -0000 From: Alexander Dahl To: linux-mtd@lists.infradead.org Subject: [PATCH 2/2] ubihealthd: Add option -h/--help Date: Thu, 3 Oct 2019 08:35:01 +0200 Message-Id: <20191003063501.18421-3-post@lespocky.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003063501.18421-1-post@lespocky.de> References: <20191003063501.18421-1-post@lespocky.de> MIME-Version: 1.0 X-Scan-Signature: 47e1ccf8997e9864e874f9390d09bff5 X-Spam-Score: -1.8 (-) X-Provags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cVORecxMLMByUd8T6aNZ3MGQ55S9ju0n9KRi+IlQGSGmoXk /2ll1S8T504mEPLc0u3D6WK6iaPnyOHfWmpDQKUxEXRUHgXLTXG+j/YwrCqL0edf5sksqj5gf S8xfGrkGRl+3+gAbU13N8UE+GEXo76mvMKl8H68kY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191002_233543_291996_6D1FCBC3 X-CRM114-Status: GOOD ( 14.04 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [217.72.192.73 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.73 listed in wl.mailspike.net] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Dahl Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Using '?' as option did not work, and would be strange to pass anyway, because it's a glob char for the shell and you would have to escape it like ./ubihealthd -\? … use the more common -h/--help instead. Note: this does not touch the output, just changes the options itself. Signed-off-by: Alexander Dahl --- ubi-utils/ubihealthd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ubi-utils/ubihealthd.c b/ubi-utils/ubihealthd.c index f38235b..27799f7 100644 --- a/ubi-utils/ubihealthd.c +++ b/ubi-utils/ubihealthd.c @@ -42,7 +42,7 @@ static int ubi_fd; static int interval_secs = 120; static int nodaemon; -static const char opt_string[] = "d:i:f"; +static const char opt_string[] = "d:i:fh"; static const struct option options[] = { { .name = "device", @@ -56,6 +56,12 @@ static const struct option options[] = { .flag = NULL, .val = 'i' }, + { + .name = "help", + .has_arg = no_argument, + .flag = NULL, + .val = 'h' + }, { /* sentinel */ } }; @@ -238,7 +244,7 @@ int main (int argc, char *argv[]) nodaemon = 1; break; } - case '?': + case 'h': default: fprintf(stderr, "Usage: %s [ -d UBI_DEVICE ] [-i INTERVAL_SEC ] [ -f ]\n", argv[0]); exit(1);