Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 11 Jun 2012 12:26:12 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Re: bash completion

On 06/11/2012 10:42 AM, magnum wrote:
> On 2012-06-11 08:12, Frank Dittrich wrote:
>> On 06/11/2012 02:39 AM, magnum wrote:
>>> On 2012-06-09 17:08, Frank Dittrich wrote:
>>> Was that supposed to fix a redirected "<file" too? I tried it now but it
>>> does not seem to make any difference in either case.
>>
>> No, sorry, my bad.
>>
>> The attached patch fixes it.
>> Also, instead of
>>
>> $ ./unique [tab][tab]
>> giving
>> $ ./unique
>> OUTPUT-FILE             [-ex_file=FNAME2]      
>> [-inp=fname]            [-v]
>> [-cut=len]              [-ex_file_only=FNAME2]  [-mem=num]
>>
>> for the jumbo version, now you get completion for file names and
>> directories.
>>
>> And I fixed unintended file name completion for -inp= and other options,
>> if the (non-jumbo) unique version doesn't support those.
> 
> Not sure what is wrong, still neither works. Could it be something odd
> with my system? (Mint 13 / Ubuntu 12).
> 
> ./unique <[TAB][TAB] gives nothing.
> 
> magnum

At least the behavior was consistent with john, and for > and 2> and so on.
The attached patch fixes this.

BTW 1:
Could you add
*~
*.patch
to the .gitignore file of your repository?

BTW 2:
How much time is left to send final patches for integration into next jumbo?


Frank



>From de3d2721b9fc0765fabed52d9997a95f5ecdb1e9 Mon Sep 17 00:00:00 2001
From: Frank Dittrich <frank_dittrich@...mail.com>
Date: Mon, 11 Jun 2012 12:20:34 +0200
Subject: [PATCH] Fix bash completion for input and output redirection (<, >,
 2>...)

---
 run/john.bash_completion |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/run/john.bash_completion b/run/john.bash_completion
index 5fc9431..ccc7387 100644
--- a/run/john.bash_completion
+++ b/run/john.bash_completion
@@ -550,12 +550,11 @@ _john()
 			return 0
 			;;
 		*)
-			_filedir
 			return 0
 			;;
 	esac
 } &&
-complete -F _john john
+complete -o bashdefault -o default -F _john john
 
 # unique
 ## have grep && have sed &&
@@ -606,9 +605,8 @@ _unique()
 			return 0
 			;;
 		_*)
-			_filedir
 			return 0
 			;;
 	esac
 } &&
-complete -F _unique unique
+complete -o bashdefault -o default -F _unique unique
-- 
1.7.7.6


Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ