Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 68D91200CA6 for ; Tue, 13 Jun 2017 14:03:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 67749160BC9; Tue, 13 Jun 2017 12:03:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B4474160BE9 for ; Tue, 13 Jun 2017 14:03:07 +0200 (CEST) Received: (qmail 62143 invoked by uid 500); 13 Jun 2017 12:03:06 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 62005 invoked by uid 99); 13 Jun 2017 12:03:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jun 2017 12:03:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B9CD01AFBE5 for ; Tue, 13 Jun 2017 12:03:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id MFNPgiOVYpv3 for ; Tue, 13 Jun 2017 12:03:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 107E65FD16 for ; Tue, 13 Jun 2017 12:03:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1B1B1E0D1A for ; Tue, 13 Jun 2017 12:03:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 38E5F21E14 for ; Tue, 13 Jun 2017 12:03:00 +0000 (UTC) Date: Tue, 13 Jun 2017 12:03:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLI-274) Option parser type EXISTING_FILE_VALUE not check file existing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 13 Jun 2017 12:03:08 -0000 [ https://issues.apache.org/jira/browse/CLI-274?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1604777= 9#comment-16047779 ]=20 ASF GitHub Bot commented on CLI-274: ------------------------------------ Github user coveralls commented on the issue: https://github.com/apache/commons-cli/pull/12 =20 =20 [![Coverage Status](https://coveralls.io/builds/11947210/badge)](https:= //coveralls.io/builds/11947210) =20 Coverage increased (+0.009%) to 96.244% when pulling **f4a28c0463a41446= 4ebe214a7790fde0b0069e3e on schaumb:patch-1** into **70a392756c713f404fed0e= 3ddd48aa18ce20485f on apache:master**. > Option parser type EXISTING_FILE_VALUE not check file existing > -------------------------------------------------------------- > > Key: CLI-274 > URL: https://issues.apache.org/jira/browse/CLI-274 > Project: Commons CLI > Issue Type: Bug > Components: Parser > Reporter: B=C3=A9la Schaum > Priority: Minor > > When the user pass option type FileInputStream.class, I think the expecte= d behavior for the return value is the same type, which the user passed. > Options options =3D new Options(); > options.addOption(Option.builder("f").hasArg().type(FileInputStream.class= ).build()); > CommandLine cline =3D new DefaultParser().parse(options, args); > FileInputStream file =3D (FileInputStream) cline.getParsedOptionValue("f"= ); // it returns "File" object, without check File exist. > I attach a solution for it: > https://github.com/schaumb/commons-cli/commit/abfcc8211f529ab75f3b3edd4a8= 27e484109eb0b -- This message was sent by Atlassian JIRA (v6.4.14#64029)