table of contents
CDARGS(1) | General Commands Manual | CDARGS(1) |
NAME¶
cdargs - bookmarks and browser for cd shell built-inSYNOPSIS¶
cdargs [ OPTIONS]DESCRIPTION¶
With cdargs you can jump to various places throughout the file-system that are defined using a plain text, line oriented bookmarks file. You can create bookmarks by editing your bookmarks file "$HOME/.cdargs" using your favorite editor, by using the "--add" option to cdargs or by using the built-in mechanism that will be described later. While you are in cdargs you can use various commands to navigate through your list of bookmarks and through the file-system. These are described below in the section "COMMANDS". The most commonly used and most obvious commands are the up/down keys for navigation, "ENTER" for selection of a path and "q" for quit. To be able to actually use this program together with the shell built-in "cd" command you must use a little trick by defining a shell function. Of course the syntax for this is different between the csh-like shells (like tcsh) and the sh-like shells (like bash). For sh-like shells:cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" ;
COMMAND-LINE OPTIONS¶
You can call cdargs with a few options, but otherwise you probably won't call it directly but via the function you defined.- -h or --help
- display usage information and exit.
- -v or --version
- output version information and exit.
- -a or --add=[:desc:]path
- add path to the bookmarks list using the optional desc as description string.
- -f or --file=FILE
- uses the given FILE as bookmarks file
- -u or --user=USER
- read the default bookmarks file of USER. Won't modify that file.
- -o or --output=FILE
- use FILE as the result-file (who knows what The World might make of this feature that I can't imagine...)
- -b or --browse
- start cdargs in BROWSE mode in the current directory.
- -r or --noresolve
- Don't exit with a result when the Needle matches a description exactly (which is some every-day-magic) but show a list (even if it contains just one entry).
- -c or --cwd
- Make the current working directory the current entry on startup if it appears on the list.
- --nowrap
- Don't wrap the cursor around when hitting the end of the list.
- Needle
- The Needle performs some magic which I hope improves the usage of cdargs.
The Needle is examined in the following order and the first thing that fits
is taken.
If Needle is a one-digit integer the appropriate entry is
preselected.
Otherwise if Needle is a string each entry of the list is checked
whether it contains Needle.
Then Needle has two functions:
COMMANDS¶
When you are in cdargs you have two modes and several commands at your hands. The two modes are LIST (when your bookmark list is displayed) and BROWSE (when you navigate through the file-system). The navigation keys are mostly available in Emacs and vi style for all maniacs out there. Common Keys- <UP>/<DOWN> or k/j or C-n/C-p
- move selection up/down and scroll.
- <ENTER>
- select current entry.
- <TAB>
- toggle modes: LIST or BROWSE.
- <HOME>/<END> or C-a/C-e
- goto first/last entry in list.
- c
- add current directory to list.
- C
- add current directory to list but ask the user for a description
- <PgUp>/<PgDown> or C-v
- Scroll the list in 10-line-steps. This will never wraparound and does not honor the nowrap-option
- e, v
- edit the list in $EDITOR.
- H, ?
- show the help-screen.
- ~, /
- browse home/root directory.
- q
- quit - saving the list.
- C-c, C-g, C-[
- abort - don't save the list.
- <LEFT>, h, C-b
- descent into current directory.
- <RIGHT>, l, C-f
- up one directory.
- [num]
- make [num] the current highlighted entry
- a
- add current entry to list.
- A
- add current entry to list but ask the user for a description, just like with 'c' and 'C'.
- .
- toggle display of hidden files.
- [num]
- select and resolve entry [num] if displayed.
- <LEFT>, h, C-b
- descent into the current entry.
- <RIGHT>, l, C-f
- up one directory from current dir.
- d or C-d
- delete current entry from list.
- s or t
- swap (transpose) two entries of the list.
- M or m
- move an entry up or down in the list and set the current position afterwards so that repeated keystrokes keep moving the same entry up and down.
SHELL FUNCTIONS¶
In addition to the shell function mentioned above you might wish to add other commands to your function. One example is to echo the directory you changed to: function cv () {cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`"
&& pwd;
cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`"
&& rm -f "$HOME/.cdargsresult";
DISPLAY¶
The cdargs window has one line at the bottom for the display of messages like when you added to your list or when you hit an unknown key. The second line from the bottom is a status line which shows the current directory and a one letter code for the current operation mode:- B
- for BROWSE
- L
- for LIST
FILES¶
/usr/bin/cdargs the cdargs executable.- $HOME/.cdargs
- personal bookmarks file.
- $HOME/.cdargsresult
- temporary file for passing results to shell.
- /usr/share/doc/cdargs/examples/cdargs-bash.sh
- example collection of bash functions.
- /usr/share/doc/cdargs/examples/cdargs-tcsh.csh
- example collection of tcsh functions.
- /usr/share/emacs/site-lisp/cdargs.el
- (X)Emacs front-end to personal bookmarks file
REPORTING BUGS¶
Report bugs to <mail@skamphausen.de>.AUTHOR¶
cdargs was written by Stefan Kamphausen with add-ons by Claus Brunzema. Many user-interface improvements came from Dan Allen.SEE ALSO¶
The current version of cdargs is located at You might want to visit that site. Other than that pressing the 'H' key in cdargs fires up a help screen.COPYRIGHT¶
Copyright © 2001-2003 Stefan Kamphausen cdargs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.March 2002 |