Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3248410201 for ; Fri, 28 Jun 2013 21:21:21 +0000 (UTC) Received: (qmail 51105 invoked by uid 500); 28 Jun 2013 21:21:20 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 51078 invoked by uid 500); 28 Jun 2013 21:21:20 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 51069 invoked by uid 99); 28 Jun 2013 21:21:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jun 2013 21:21:20 +0000 Date: Fri, 28 Jun 2013 21:21:20 +0000 (UTC) From: "Chris Nauroth (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-9660) [WINDOWS] Powershell / cmd parses -Dkey=value from command line as [-Dkey, value] which breaks GenericsOptionParser MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-9660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13695810#comment-13695810 ] Chris Nauroth commented on HADOOP-9660: --------------------------------------- Thanks, Enis. It's a good point about the many years of online documentation and books. Without this change, a Windows user might not be able to just paste in those samples and have it work. The patch itself looks really good. Just a couple of minor style nits: the test has a few lines that need to be wrapped at 80 characters, and the last line would be shorter by importing {{java.util.Arrays}} instead of spelling out the full class name for each call. Thanks also for the clarification that passing just -D isn't supported anyway. With that aside, I can't think of any other problematic edge cases. I'd appreciate it if we could get a +1 (or additional feedback) from Chuan or someone else at Microsoft before I commit this. I don't know Powershell well enough to know if there are other edge cases to consider. :-) > [WINDOWS] Powershell / cmd parses -Dkey=value from command line as [-Dkey, value] which breaks GenericsOptionParser > ------------------------------------------------------------------------------------------------------------------- > > Key: HADOOP-9660 > URL: https://issues.apache.org/jira/browse/HADOOP-9660 > Project: Hadoop Common > Issue Type: Bug > Components: scripts, util > Reporter: Enis Soztutar > Assignee: Enis Soztutar > Fix For: 3.0.0, 2.1.0-beta > > Attachments: hadoop-9660-branch1_v1.patch, hadoop-9660-branch2_v1.patch > > > When parsing parameters to a class implementing Tool, and using ToolRunner, we can pass > {code} > bin/hadoop -Dkey=value > {code} > However, powershell parses the '=' sign itself, and sends it to java as ["-Dkey", "value"] which breaks GenericOptionsParser. > Using "-Dkey=value" or '-Dkey=value' does not fix the problem. The only workaround seems to trick PS by using: > '"-Dkey=value"' (single + double quote) > In cmd, "-Dkey=value" works, but not '"-Dkey=value"'. > http://stackoverflow.com/questions/4940375/how-do-i-pass-an-equal-sign-when-calling-a-batch-script-in-powershell -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira