#Directory Completer
18 messages in this thread
In LIB 9:
CDD.LHA/Bin Bytes: 2621
Title : Directory completer in Arexx
Keywords: DIR DIRECTORY COMPLETE MARTENS REXX AREXX
Tired of typing things like: cd
Eskarina:Graphics/Imagine/Projects/Diamond.imp/1.pix/anim
Here's a little Arexx script whith which you can enter d Es:g/i/p/d/1/a
instead and get to the same directory.
This looks like an interesting Arexx script…
In case people are not aware, under 2.0 it supports wild cards such that
you could also type:
cd eskarina:g#?/i#?/p#?/d#?/1#?/a#?
I realize it is a little longer, but with stars enabled it means you don't
have to worry about a new command in addition. Just a piece of
information that most people don't seem to be aware of.
— John A. Toebes, VIII — Obvious Implementations Corp.
— Internet: toebes@oic.com
And of course those of us with WShell also tend to use the filename
completion, which is handy for files as well as directories.
-larry
That goes without saying. Doesn't everyone use WShell and Display
Handler? 🙂 😉 🙂
— John A. Toebes, VIII — Obvious Implementations Corp.
— Internet: toebes@oic.com
Display Handler? Rings a bell… what is it?
Does WShell work on 1200/4000s? I have it, but I only used it back when,
when I was using my 500.
Paul
Display Handler is the best part of Bills Wshell 2.0 package. It has
history, jumping, scroll back, and user programmable menus. Wshell works
just about anywhere and is certainly worth the investment. Bill is on
here somewhere…
— John A. Toebes, VIII — Obvious Implementations Corp.
— Internet: toebes@oic.com
John,
not everyone. CShell here <g>.
Brian
bjbart@watserv.ucr.edu
Larry,
You're right, it works with wildcards too but I have thousands of directories
and all you get is 'More than one directory matches' if you've got tons of
directiries that start with the same letters. I like to be able to select the
directory I want and I'm a lazy slug and try to avoid typing whenever possible.
— Quinten
Interesting, if you get more than one directory match, how does the Arexx
program select the right one? Given that we happen to have source code to
the CD command (Doug Walker wrote it for 2.0), it is possible to enhance
it to be more intelligent. Something like first match?
— John A. Toebes, VIII — Obvious Implementations Corp.
— Internet: toebes@oic.com
> Given that we happen to have source code to the CD command
> […] it is possible to enhance it
Neat idea. How about presenting a numbered list of the directories
found via wildcard to stdout and looking to stdin for a number to be
entered by the user? 🙂
— Tom
That looks like it could work. Clearly there would have to be an option
to control this (so that it knows it has an interactive console. I like
this. I will pass it on to Doug, or see if I can attack it as soon as the
current project is shipping.
— John A. Toebes, VIII — Obvious Implementations Corp.
— Internet: toebes@oic.com
Sounds neat! I'll be glad to help beta test it. 🙂
John,
The script pops up a little window and lets you select a directory.
— Quinten
John,
the way CShell handles it is to change to each directory in turn. If I
type 'cd ib#?' it'll go to the first match, then if I repeat the same
command it will go to the next match. I just hit the up arrow and enter
until I get the right directory. So, the idea isn't impossible.
Brian
bjbart@watserv.ucr.edu
Unfortunately that makes it a little non-predictable and requires saving
additional state information within the context of the shell. I don't
believe that we have the luxory of that. Or do I misunderstand the
implementation?
— John A. Toebes, VIII — Obvious Implementations Corp.
— Internet: toebes@oic.com
I did some digging and I think I see where it's keeping the
previous match, in _cwd. So, you'd need something like that. It
also maintains a list of directories in a small database, something
like Larry's find. Between those two, it manages.
I understand. The problem you run into that is that it falls into
the creeping resources mode/dangling locks. Thanks. — John A.
Toebes, VIII — Obvious Implementations Corp. — Internet:
toebes@oic.com