Message ID | 1519202756-23590-1-git-send-email-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBSPDWTKAKGQETA5QQVY@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c0c::23f; helo=mail-wr0-x23f.google.com; envelope-from=swupdate+bncbcxploxj6ikrbspdwtkakgqeta5qqvy@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="GI0Rir9U"; dkim-atps=neutral Received: from mail-wr0-x23f.google.com (mail-wr0-x23f.google.com [IPv6:2a00:1450:400c:c0c::23f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zmWKm6X10z9ryG for <incoming@patchwork.ozlabs.org>; Wed, 21 Feb 2018 19:46:04 +1100 (AEDT) Received: by mail-wr0-x23f.google.com with SMTP id 62sf802104wrg.0 for <incoming@patchwork.ozlabs.org>; Wed, 21 Feb 2018 00:46:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1519202762; cv=pass; d=google.com; s=arc-20160816; b=kthrt6VQZWSrXE8bzFc+0HjxKB2AFX4qtC967Nja6FYdGi4IJ3j7cxX6qJ4rqt/gR4 JKSILyTdnCOJ8TxzG27TtvWH6PRntMDKuRWHecZ+DAwoqYBt8rw6VoGr7rcRP1wqw/D6 lw4HBtGf1MqrT+ymur0AP2BPBSq1bGL5pnAJoor4F1Ny+9u239GYkuAuUiI2pth72Z2k gT34ujnWHnVZI9fVPhY15thk6hV14W7ue20I8coG9aIxQOxhggDc9ykIlkyoSX2pkGdX FDzWZAYvHI12eGYCcLQPiLm34hsjmZLU20u4uLJeVBW+HLCbgDd79F0TtNtwPDFrLIvf lcMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=nM8rGAxbI5GnrUDmIvaYgQF6ejzYKmip4TLcZYJ6emw=; b=1BppqBIPHkBWrvxCGt76js1kyThd4qLnHXgzT/PYUjfqLcx8CoEFgsmXlm/H9ew4Tq VckXnsTUggpT+3W4jNmSotSA+iO1ilqBOajUO2OcebsEYkPk/JE0Qh6NOO5T/5RmBjgE eUctK5LVZWwgI1IBZO8F2/+f4Q/3euUhHTPvSX3bywUtTCQIxNOlz5voQcXZHtURhPPI t60kCgV/a2t57P/+CDkeR/xM9+wICiXZUAJo07J9UPZBpzBlmwpCH8fr5DP94VcUR4TL +Y9tULEa/QFcaBzAkXAuEhKgH4HMNYI0gBKt+R8fnj9jm3GbTfmNJ98dH7uJMIpgmTV6 urkQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=nM8rGAxbI5GnrUDmIvaYgQF6ejzYKmip4TLcZYJ6emw=; b=GI0Rir9UV/ylAQ46tE7mZGVslF/0PjXBbu3ooYpmnzmRpkUrfSsTvweVAHXhovGDOz xIZplOZZU99Yk3gBLtBdU+D2tpoPgBbsNzLzm5c9IBIRfOdBxpv2CQ3i2nNc7i32EoT6 nafmzqUpPIPtlkRh4aJlgfbsOuJcC6vejSjSLxan1AJ/H+z3dqpz4j3yVUif90CFM3fA 4pcEvv1NERW1vXxCmh7/7R5mweshVbtsoGdhnZNpwDGx1zZjp7du+9PpsU57fQ2gD7up O+YeIv4qFaciWJrlDWEGrX9FLAnG98UDqav1Nu3JDkvqI08yeYXDIreNheyhS1DMKaZi r9GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=nM8rGAxbI5GnrUDmIvaYgQF6ejzYKmip4TLcZYJ6emw=; b=eFM4w9Pt/I/j66ycjbtEahPz/9TrRArlbNvjySDpzlwFPCTy8EawLAi/BCOU9LE1ZV 8ha4gKdrNxDWESM/w6LB10avQyx84Z2d7kTCIJQKjPaShNM7uZEzDpB0D/MyJsRWjHD8 L35lcI2g14yNiblTlchDseWT89eeWrsAp79uBq/i0HNtm0YBvYRhdh3Vw+Wnmj9mfXw8 78ZnHOC+3B7yUcd+Uasbq4o5Fq6AHsC1izWb1GYwehGWZYuFyAasQ1cikK8Y0HnN+gg8 Nxmib6M0lDJ9B4OuuETm+oOo63kbkoinQcbEBgHb4QbcBTcmb0Fc9Lw+ey/l3W7QDEQz 8ufw== Sender: swupdate@googlegroups.com X-Gm-Message-State: APf1xPABEnSAQF9Pj/woBq12I+Q5Qhl4Iba7AyHKY7DzUt7HdlDOaF1I vmQXZD9dr6WnBfR/RKJ1PCU= X-Google-Smtp-Source: AH8x226OngppP0RViSDYPn52o3UNiUJPlhLaWNnR4EOZA+GCyftsGa/nGcjpNBWZ6ZFMOqAil6GIHw== X-Received: by 10.28.55.8 with SMTP id e8mr24509wma.7.1519202762034; Wed, 21 Feb 2018 00:46:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.80.205.208 with SMTP id h16ls477285edj.5.gmail; Wed, 21 Feb 2018 00:46:01 -0800 (PST) X-Received: by 10.80.149.230 with SMTP id x35mr912603eda.3.1519202761265; Wed, 21 Feb 2018 00:46:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519202761; cv=none; d=google.com; s=arc-20160816; b=dbnCHGtfjuqzTFxE8G1zDe1TCLlZYHdp4OdqiBJO5UJSwydh/n322l4DyqaaBynN0f 1OGHRHq2gvOHklOUGo15HndtRUUCyq8i9gM3q+dgtg51NmKpIniaOXntfSPTdYI237dE FQCy+Sx1IXNLU3xnZmngtibezvQOPbcMxM1VB722bokIUUfzyu4WUNgmHPEsgxULxO2Q o/TCDm6LudIyMYKP3RmE/ZGTbkU6ZrL5MQZE+NzooZ55MVqVjSJ6Fffe2Vb3xAnUB41V JwCuZKL2P9BwA5oVmMX9usRJWUl9sbS5jrEWWAVIHbExSVROx2UyRbalxoeEeDCrMQJ3 PIKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=+hmbfV+9SKkorqLJZZyIZelUfeWWw1aOI0uwe3pgBF0=; b=yPmUdC4sMIdUaa9iNQGtzEmqjCKU21Po+vKL0sS8qm+lTqCTlybykxt9hTfzJxfngM fBLHSSj05zfk6DGtOQuxWzd3kOm/evNdGHEIwE3U+m/esJubwQZszjUNHhqHNFOeOUQm 4tp3wb9J9HKIui1Rb8akygaSu6X1d0x9MuDEGMBQ3jIJJbJLPWnpTvQ0X175CO9pDFe/ 0+jE0j/z+mTny6u66Qo1uGInTPK6mmoYGhLAIu0ZXVRUVstIaT2N3sIZ67+2R4EJAhVo J+Sr4hExRFmX7qh1ZTPcPE2SXUVbaKurplpiCKyzWqk/jm0ufuRDUoTIITksHmcnqwrD BXIg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id z1si8633edh.3.2018.02.21.00.46.01 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 00:46:01 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zmWKh6zm9z1qyLF; Wed, 21 Feb 2018 09:46:00 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zmWKh6nWkz1r0R3; Wed, 21 Feb 2018 09:46:00 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id XDlqSyrZQ6jF; Wed, 21 Feb 2018 09:46:00 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 21 Feb 2018 09:46:00 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id DEFD645402F0; Wed, 21 Feb 2018 09:45:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DrYvUog4pdJE; Wed, 21 Feb 2018 09:45:57 +0100 (CET) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id B1B88454027E; Wed, 21 Feb 2018 09:45:57 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH] Add parameter to ask SWUpdate version Date: Wed, 21 Feb 2018 09:45:56 +0100 Message-Id: <1519202756-23590-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 2.7.4 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
Add parameter to ask SWUpdate version
|
expand
|
diff --git a/core/swupdate.c b/core/swupdate.c index 430bb96..0538b74 100644 --- a/core/swupdate.c +++ b/core/swupdate.c @@ -70,6 +70,7 @@ struct flash_description *get_flash_info(void) { static struct option long_options[] = { {"verbose", no_argument, NULL, 'v'}, + {"version", no_argument, NULL, '0'}, {"image", required_argument, NULL, 'i'}, {"file", required_argument, NULL, 'f'}, {"loglevel", required_argument, NULL, 'l'}, @@ -572,10 +573,6 @@ int main(int argc, char **argv) memset(fname, 0, sizeof(fname)); - printf("%s\n", BANNER); - printf("Licensed under GPLv2. See source distribution for detailed " - "copyright notices.\n\n"); - /* Initialize internal database */ swupdate_init(&swcfg); @@ -618,9 +615,16 @@ int main(int argc, char **argv) exit(1); } break; + case '0': + printf("%s", BANNER); + exit(0); } } + printf("%s\n", BANNER); + printf("Licensed under GPLv2. See source distribution for detailed " + "copyright notices.\n\n"); + /* * Command line should be parsed a second time * This let line parameters overload
Return immediately SWUpdate's version. This can be used in scripts when command line parameters depend on SWupdate's version. Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/swupdate.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)