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 C9C22200CB5 for ; Wed, 12 Jul 2017 22:17:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C859616A067; Wed, 12 Jul 2017 20:17:10 +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 1C74016A04A for ; Wed, 12 Jul 2017 22:17:09 +0200 (CEST) Received: (qmail 81408 invoked by uid 500); 12 Jul 2017 20:17:09 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 81396 invoked by uid 99); 12 Jul 2017 20:17:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jul 2017 20:17:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id BFFE1180BB2 for ; Wed, 12 Jul 2017 20:17:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id SKwirZOZL8hn for ; Wed, 12 Jul 2017 20:17:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 1E2C262443 for ; Wed, 12 Jul 2017 20:17:07 +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 B93F5E0D95 for ; Wed, 12 Jul 2017 20:17:05 +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 2978D2472C for ; Wed, 12 Jul 2017 20:17:01 +0000 (UTC) Date: Wed, 12 Jul 2017 20:17:01 +0000 (UTC) From: "Carlo Dapor (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (KARAF-5246) Karaf shell command crashed on tab-completion when quotes are used MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 12 Jul 2017 20:17:11 -0000 Carlo Dapor created KARAF-5246: ---------------------------------- Summary: Karaf shell command crashed on tab-completion when quotes are used Key: KARAF-5246 URL: https://issues.apache.org/jira/browse/KARAF-5246 Project: Karaf Issue Type: Bug Components: karaf-shell Affects Versions: 4.0.9 Reporter: Carlo Dapor Commands bail out when a starting quote preceed a tab-completion. E.g.: Type {code:java} feature:install -s {code} and hit the tab key, you are prompted with the question whether you want to see all 40+ completions. But if you type {code:java} feature:install -s " # also with a single quote, btw {code} and then hit the tab key, you see an error: {color:red}Error executing command: String index out of range: 21{color} The log shows: {noformat} 2017-07-12 21:39:44,803 | ERROR | nsole user karaf | ShellUtil | 43 - org.apache.karaf.shell.core - 4.0.9 | Exception caught while executing command java.lang.StringIndexOutOfBoundsException: String index out of range: 21 at java.lang.String.substring(String.java:1963)[:1.8.0_131] at org.apache.karaf.shell.support.parsing.GogoParser.value(GogoParser.java:300)[43:org.apache.karaf.shell.core:4.0.9] at org.apache.karaf.shell.support.parsing.GogoParser.messy(GogoParser.java:223)[43:org.apache.karaf.shell.core:4.0.9] at org.apache.karaf.shell.support.parsing.GogoParser.statement(GogoParser.java:195)[43:org.apache.karaf.shell.core:4.0.9] at org.apache.karaf.shell.support.parsing.DefaultParser.parse(DefaultParser.java:34)[43:org.apache.karaf.shell.core:4.0.9] at org.apache.karaf.shell.impl.console.parsing.CommandLineParser.buildCommandLine(CommandLineParser.java:56)[43:org.apache.karaf.shell.core:4.0.9] at org.apache.karaf.shell.impl.console.CompleterAsCompletor.complete(CompleterAsCompletor.java:42)[43:org.apache.karaf.shell.core:4.0.9] at jline.console.ConsoleReader.complete(ConsoleReader.java:3296)[9:jline:2.14.1] at jline.console.ConsoleReader.readLine(ConsoleReader.java:2636)[9:jline:2.14.1] at jline.console.ConsoleReader.readLine(ConsoleReader.java:2362)[9:jline:2.14.1] at jline.console.ConsoleReader.readLine(ConsoleReader.java:2350)[9:jline:2.14.1] at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.readAndParseCommand(ConsoleSessionImpl.java:373)[43:org.apache.karaf.shell.core:4.0.9] at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:269)[43:org.apache.karaf.shell.core:4.0.9] at java.lang.Thread.run(Thread.java:748)[:1.8.0_131] {noformat} What I would like to achieve, actually is with a StringsCompleter that accepts say 4 constants ("CODE", "TIME", "RUN", "ERROR"), I'd like to get multiple completions in the end. In other words, I would like to be able to this: > cool-command --expr '({color:#14892c}CODE{color}="A34" and {color:#14892c}TIME{color}=60) or ({color:#14892c}RUN{color} > 10 and {color:#14892c}ERROR{color}="E517")' where each {color:#14892c}green{color} completion above I would tab-select as I type along. This is currently not possible. -- This message was sent by Atlassian JIRA (v6.4.14#64029)