Bug 1103783

Summary: [GSS] (6.4) Code completion in CLI should handle ~ specifically and replace it by appropriate value
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Radim Hatlapatka <rhatlapa>
Component: CLIAssignee: Alexey Loubyansky <olubyans>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbaranow, brian.stansberry, kkhan
Target Milestone: DR1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
UNIX-like platforms
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1055898    

Description Radim Hatlapatka 2014-06-02 14:25:24 UTC
Description of problem:
When using ~ in path using CLI completion for file paths (the only place I know of is patch apply command), it is directly passed as String. The ~ is sh specific and Java doesn't understand it. It should be automatically expanded to appropriate value ($HOME)

Version-Release number of selected component (if applicable):


How reproducible: always


Steps to Reproduce:
1. put some valid patch for EAP to ~/
2. start jboss-cli client
3. use patch apply ~/... with path completion (using tab for completion)

Actual results:
String remains with ~/..


Expected results:
String should be replace with $HOME/.... => /home/username/patch.zip

Additional info:
~ in JAVA doesn't have the same special meaning as it has in bash

Comment 1 Alexey Loubyansky 2014-07-09 10:33:59 UTC
Looks like it's been fixed in wildfly 8.0.0.Final. The string, though, is still not replaced on the command line, it remains looking the way the user entered it. The tab-completion works properly, though, and the path gets resolved correctly during the command execution.

Comment 3 Alexey Loubyansky 2014-07-21 14:05:13 UTC
The PR is https://github.com/jbossas/jboss-eap/pull/1531

Comment 4 Petr Kremensky 2014-09-19 08:04:19 UTC
Using EAP 6.2.1 patch for test purposes.

6.3.0.GA
[disconnected /] patch apply ~/jboss-eap-6.2.1.zip
Path /home/pkremens/jboss-eap-6.3/bin/~/jboss-eap-6.2.1.zip doesn't exist.

6.4.0.DR1.1
[disconnected /] patch apply ~/jboss-eap-6.2.1.zip
JBAS016840: Patch does not apply - expected (6.2.0.GA), but was (6.4.0.Alpha1)

Verified on EAP 6.4.0.DR1.1