Issue Details (XML | Word | Printable)

Key: HADOOP-3714
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Chris Smith
Reporter: Chris Smith
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

Bash tab completion support

Created: 08/Jul/08 03:16 PM   Updated: 20/Nov/08 11:38 PM
Return to search
Component/s: scripts
Affects Version/s: None
Fix Version/s: 0.19.0

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works hadoop-bash-tab-completion 2008-07-14 09:56 AM Chris Smith 5 kB
File Licensed for inclusion in ASF works hadoop-bash-tab-completion 2008-07-10 02:19 PM Chris Smith 4 kB

Hadoop Flags: Reviewed
Release Note: Adds a new contrib, bash-tab-completion, which enables bash tab completion for the bin/hadoop script. See the README file in the contrib directory for the installation.
Resolution Date: 14/Jul/08 05:23 PM


 Description  « Hide
The attached Bash script adds support for tab completion of most arguments to the main Hadoop script (bin/hadoop). Namely, it allows tab completion of all the command names, subcommands for the fs, dfsadmin, job, namenode and pipe commands, arguments of the jar command and most arguments to the fs subcommands (completing local and dfs paths as appropriate).

The file can be dropped into /etc/bash_completion.d/ on Debian-like distros, and it should then start working the next time Bash is started.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Enis Soztutar added a comment - 10/Jul/08 12:51 PM
Very useful patch.
We can include this in a new contrib bash-tab-completion. Could you please provide a patch for it, and supply a README file.
More minor thing I noticed is that it displays "or" as a first command (I guess originating from the hadoop script).

Chris Smith added a comment - 10/Jul/08 02:19 PM
Attached patch that puts the script in src/contrib/bash-tab-completion, and includes a README file.

Also fixed the off-by-one error which caused 'or' to be suggested as a top-level command.


Hadoop QA added a comment - 12/Jul/08 07:23 PM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12385764/hadoop-bash-tab-completion
against trunk revision 676069.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

-1 release audit. The applied patch generated 210 release audit warnings (more than the trunk's current 209 warnings).

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2845/testReport/
Release audit warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2845/artifact/trunk/current/releaseAuditDiffWarnings.txt
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2845/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2845/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2845/console

This message is automatically generated.


Chris Smith added a comment - 14/Jul/08 09:56 AM
Added ASF license to the script

Hadoop QA added a comment - 14/Jul/08 01:32 PM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12385967/hadoop-bash-tab-completion
against trunk revision 676069.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

+1 release audit. The applied patch does not increase the total number of release audit warnings.

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2857/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2857/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2857/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2857/console

This message is automatically generated.


Chris Smith added a comment - 14/Jul/08 02:45 PM
I don't think it's hugely practical (it requires bash and a working Hadoop install, and its inputs and outputs are env vars) or necessary (it's relatively simple, and flexible enough to work against 0.16.x and 0.19.x, so I don't think that [m]any changes in the future will affect it) to unit test this, so would propose that it's included as-is

Enis Soztutar added a comment - 14/Jul/08 05:23 PM
I've committed this. Thanks Chris !

Hudson added a comment - 22/Aug/08 12:34 PM