From patchwork Fri Oct 2 13:00:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 525524 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 758AF140D88 for ; Fri, 2 Oct 2015 23:42:08 +1000 (AEST) Received: from localhost ([::1]:59844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi0b8-0005ba-0n for incoming@patchwork.ozlabs.org; Fri, 02 Oct 2015 09:42:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zhzxg-0005KQ-Dz for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zhzxc-0000b6-2e for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:20 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:33662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zhzxb-0000b0-SU for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:16 -0400 Received: by lafb9 with SMTP id b9so3893834laf.0 for ; Fri, 02 Oct 2015 06:01:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+sEz//3q7ag0f6jjUEiqzNY0QM0q5PV7NsRbtP2g1jc=; b=B+nkdC8s2Yw9snAg39WKhTYBqDQ5JFI04cDGaSIcejGkmt8a4gGLrhZzsR7qPEIHnY 2vm1vDgvWb7cFPABWNRV3PDJh8Fi727bSgQW86J6uFeyzuutYAmimvxTtNOzxUeMI1U3 DG89diZFfwDalR9o0QV+cM3ZT2VEPFPv+GqysweCx06sqpKMA8QC/ouLtRj9S3Fdl5gO goWt6Wz4OHzu9LWgvpR8RdJbbiORn1URllIoUcLJHoOn19grtWTlxO4uZbDbe19Kmpn5 tG0/xfXrMop+vx9JUMqrdot67zE+uTkTXnE77mqLqGrDKcCABTCQe6CWzDNaTAmI7ylV TXYw== X-Gm-Message-State: ALoCoQkOTkEpjHdE8Nekpc3FJc9rMcSTCwEagU72mjqWAZ9Rt8ezPVMSPtcs0wdX1XPfhMl8bH13 X-Received: by 10.25.160.133 with SMTP id j127mr3454129lfe.85.1443790875139; Fri, 02 Oct 2015 06:01:15 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by smtp.gmail.com with ESMTPSA id w143sm1514751lfd.2.2015.10.02.06.01.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Oct 2015 06:01:14 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 2 Oct 2015 16:00:57 +0300 Message-Id: X-Mailer: git-send-email 2.5.3 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.47 Cc: Meador Inge Subject: [Qemu-devel] [PULL 05/13] linux-user: Treat --foo options the same as -foo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Meador Inge The system mode binaries provide a similar alias and it makes common options like --version and --help work as expected. Signed-off-by: Meador Inge Signed-off-by: Riku Voipio --- linux-user/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index c7c39d4..6599a41 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4024,6 +4024,10 @@ static int parse_args(int argc, char **argv) if (!strcmp(r, "-")) { break; } + /* Treat --foo the same as -foo. */ + if (r[0] == '-') { + r++; + } for (arginfo = arg_table; arginfo->handle_opt != NULL; arginfo++) { if (!strcmp(r, arginfo->argv)) {