-
Notifications
You must be signed in to change notification settings - Fork 0
Features
$ dir
Just run dir. You will be asked to select one of the bookmarked directories.
After picking a directory, your shell is cd to it thereafter.
It's a quick way one can change their working directory to another among a list of common directories they use.
dir now has a driller feature. Use it by passing a directory as the first argument to dir. For example, to get a dir picker using your current working directory, run dir .. Similarly, it is possible to pass dir .. to get a picker for one directory upward.
The driller (using find) will locate every shallow subdirectory from the specified folder and present it to you.
Right now, the only way to add bookmarks is by editing the config file. Assuming the EDITOR environment variable is set to your text editor, dir cfg can be used to pull up the config file. The command interpreter should be modified to facilitate bookmarks via routine invocations.
The remaining design consideration is to provide a suitable interface for specifying the folder's label.
Internally, dir uses pushd, which means you can use popd to get back to the folder you were in before (or cd -, for those keeping track).
Users should not call dirp directly. Doing so only reveals how the program works. If you check the output from dirp when invoked directly, you always see a file path of some kind after making a choice.
Future versions of dirp may add special behavior for direct invocation, but right now, there is simply no use for it. That is, always use dir, the shell function, as your entrypoint to the dirp software. See Design for more detail on the implementation being a function.