| 1 |
COMPILATION |
| 2 |
=========== |
| 3 |
Installation is easy, do: |
| 4 |
|
| 5 |
$ configure |
| 6 |
$ make |
| 7 |
|
| 8 |
then become root and do: |
| 9 |
|
| 10 |
# make install-strip |
| 11 |
|
| 12 |
If you're not content with the displayed width of the description you |
| 13 |
might want to change cdargs.cc. Look for the lines |
| 14 |
# define DESCRIPTION_MAXLENGTH 18 |
| 15 |
# define DESCRIPTION_BROWSELENGTH 8 |
| 16 |
and change the numbers according to your taste. |
| 17 |
|
| 18 |
CREATE SHELL FUNCTION(S) |
| 19 |
======================== |
| 20 |
For Versions 1.19 And Newer (bash) |
| 21 |
---------------------------------- |
| 22 |
Simply copy the file contrib/cdargs-bash.sh somewhere into your $PATH |
| 23 |
and put a line like |
| 24 |
source cdargs-bash.sh |
| 25 |
in your ~/.bashrc. This loads some very useful functions into your shell. |
| 26 |
(Please note that these functions could be improved but I don't have |
| 27 |
enough bash knowledge for that.) |
| 28 |
|
| 29 |
For Versions 1.20 And Newer (tcsh) |
| 30 |
---------------------------------- |
| 31 |
Copy the file contrib/cdargs-tcsh.csh to a place that you like and |
| 32 |
source it from your ~/.cshrc (or ~/.tcsh ?). |
| 33 |
Please note that I don't know much about tcsh (im bashi-ish) and thus |
| 34 |
this might be quite quirky... Any help appreciated in making the tcsh |
| 35 |
expansion as powerfull as Dan's bash functions. |
| 36 |
|
| 37 |
For Older Versions |
| 38 |
------------------ |
| 39 |
Put a line like the following into your shell startup-script |
| 40 |
(.profile, .bashrc, .zshrc, whatever) to create a shell function: |
| 41 |
|
| 42 |
function cv () { cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" } |
| 43 |
|
| 44 |
If you want to you can remove the file in your homedirectory after successfully |
| 45 |
using cdargs: |
| 46 |
|
| 47 |
function cv () { cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" && rm -f "$HOME/.cdargsresult" } |
| 48 |
|
| 49 |
or you can echo the directory you changed to: |
| 50 |
|
| 51 |
function cv () { cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" && pwd ; } |
| 52 |
|
| 53 |
Another thing you might find useful is an alias for adding paths: |
| 54 |
function ca () { cdargs --add="$1" ; } |
| 55 |
function capwd () { cdargs --add=":$1:"`pwd` ; } |
| 56 |
|
| 57 |
|
| 58 |
(Note that the '&&' is just possible since version 1.11 which |
| 59 |
introduced a reasonable return code to cdargs. Both version should work.) |
| 60 |
|
| 61 |
WRAPPING |
| 62 |
======== |
| 63 |
If you do not like the cursor wrapping around on the top and the |
| 64 |
bottom of the list, start cdargs with the additional option --nowrap: |
| 65 |
|
| 66 |
Example: |
| 67 |
function cb () { cdargs --nowrap "$1" && cd `cat $HOME/.cdargsresult` ; } |
| 68 |
|
| 69 |
|
| 70 |
MORE HELP |
| 71 |
========= |
| 72 |
For more information try: |
| 73 |
|
| 74 |
$ configure --help |
| 75 |
$ cdargs --help |
| 76 |
or press 'H' or '?' while running cdargs. |
| 77 |
|
| 78 |
Additionally since version 1.16 cdargs comes with a manpage. |
| 79 |
|
| 80 |
GNU/X Emacs |
| 81 |
=========== |
| 82 |
Since version 1.24 there is a cdargs.el which you just put somewhere |
| 83 |
where Emacs can find it (see variable load-path) and the require it in |
| 84 |
your personal init file (may be one of ~/.emacs, ~/.xemacs/init.el |
| 85 |
~/.xemacs/my/config/personal.el or something else): |
| 86 |
(require 'cdargs) |
| 87 |
|
| 88 |
Appendix: |
| 89 |
========= |
| 90 |
|
| 91 |
Creating an RPM (thanks Oron!) |
| 92 |
------------------------------ |
| 93 |
|
| 94 |
First way (assuming all directories relative to /usr/src/redhat): |
| 95 |
- Put the .spec file in the SPECS directories |
| 96 |
- Put the tar.gz file in the SOURCES directory |
| 97 |
- From the SPECS directory run: |
| 98 |
rpm -bb cdargs.spec # to build only binary RPM |
| 99 |
rpm -bs cdargs.spec # to build only source RPM |
| 100 |
rpm -ba cdargs.spec # to build both |
| 101 |
Second way (assuming the tar.gz file contains .spec file): |
| 102 |
- Simply run: |
| 103 |
rpm -ta cdargs-<version>.tar.gz |
| 104 |
|
| 105 |
The resulting binary RPM will be below the RPMS directory (e.g: |
| 106 |
RPMS/i386). |
| 107 |
|
| 108 |
Signing The Tarball |
| 109 |
------------------- |
| 110 |
The whole thing, including the tarball: |
| 111 |
gpg -a --sign cdargs-<version>.tar.gz |
| 112 |
|
| 113 |
Just the signature: |
| 114 |
gpg -ab --default-key 0BA0A295 --sign cdargs-<version>.tar.gz |
| 115 |
|