Commit 2bc12567 authored by Francois Marier's avatar Francois Marier

Remove all patches to the upstream code

parent f9dc1233
#!/bin/sh
# (C) 2002-2003 Dan Allen and Stefan Kamphausen
# Written by Dan Allen <dan@mojavelinux.com>
......@@ -30,15 +32,15 @@ function _cdargs_get_dir ()
# if there is one exact match (possibly with extra path info after it),
# then just use that match without calling cdargs
if [ -e "$HOME/.cdargs" ]; then
dir=`/bin/grep "^$1 " "$HOME/.cdargs"`
dir=`grep "^$1 " "$HOME/.cdargs"`
if [ -z "$dir" ]; then
bookmark="${1/\/*/}"
if [ "$bookmark" != "$1" ]; then
dir=`/bin/grep "^$bookmark " "$HOME/.cdargs"`
extrapath=`echo "$1" | /bin/sed 's#^[^/]*/#/#'`
dir=`grep "^$bookmark " "$HOME/.cdargs"`
extrapath=`echo "$1" | sed 's#^[^/]*/#/#'`
fi
fi
[ -n "$dir" ] && dir=`echo "$dir" | /bin/sed 's/^[^ ]* //'`
[ -n "$dir" ] && dir=`echo "$dir" | sed 's/^[^ ]* //'`
fi
if [ -z "$dir" -o "$dir" != "${dir/
/}" ]; then
......@@ -47,7 +49,7 @@ function _cdargs_get_dir ()
dir=
if cdargs --noresolve "${1/\/*/}"; then
dir=`cat "$HOME/.cdargsresult"`
/bin/rm -f "$HOME/.cdargsresult";
rm -f "$HOME/.cdargsresult";
fi
fi
if [ -z "$dir" ]; then
......@@ -164,10 +166,10 @@ function mark ()
local tmpfile
# first clear any bookmarks with this same alias, if file exists
if [ "$CDARGS_NODUPS" -a -e "$HOME/.cdargs" ]; then
tmpfile=`echo ${TEMP:-${TMPDIR:-/tmp}} | /bin/sed -e "s/\\/$//"`
if [[ "$CDARGS_NODUPS" && -e "$HOME/.cdargs" ]]; then
tmpfile=`echo ${TEMP:-${TMPDIR:-/tmp}} | sed -e "s/\\/$//"`
tmpfile=$tmpfile/cdargs.$USER.$$.$RANDOM
/bin/grep -v "^$1 " "$HOME/.cdargs" > $tmpfile && 'mv' -f $tmpfile "$HOME/.cdargs";
grep -v "^$1 " "$HOME/.cdargs" > $tmpfile && 'mv' -f $tmpfile "$HOME/.cdargs";
fi
# add the alias to the list of bookmarks
cdargs --add=":$1:`pwd`";
......@@ -216,7 +218,7 @@ function _cdargs_aliases ()
cur=${COMP_WORDS[COMP_CWORD]}
if [ "$cur" != "${cur/\//}" ]; then # if at least one /
bookmark="${cur/\/*/}"
dir=`/bin/grep "^$bookmark " "$HOME/.cdargs" | /bin/sed 's#^[^ ]* ##'`
dir=`grep "^$bookmark " "$HOME/.cdargs" | sed 's#^[^ ]* ##'`
if [ -n "$dir" -a "$dir" = "${dir/
/}" -a -d "$dir" ]; then
strip="${dir//?/.}"
......@@ -224,8 +226,8 @@ function _cdargs_aliases ()
IFS='
'
COMPREPLY=( $(
compgen -d "$dir`echo "$cur" | /bin/sed 's#^[^/]*##'`" \
| /bin/sed -e "s/^$strip/$bookmark/" -e "s/\([^\/a-zA-Z0-9#%_+\\\\,.-]\)/\\\\\\1/g" ) )
compgen -d "$dir`echo "$cur" | sed 's#^[^/]*##'`" \
| sed -e "s/^$strip/$bookmark/" -e "s/\([^\/a-zA-Z0-9#%_+\\\\,.-]\)/\\\\\\1/g" ) )
IFS="$oldIFS"
fi
else
......@@ -254,14 +256,4 @@ _cdargs_complete() {
complete $nospace -S / -X '*/' -F _cdargs_aliases cv cb cdb
}
# Support ZSH via its BASH completion emulation
if [ -n "$ZSH_VERSION" ]; then
autoload bashcompinit
bashcompinit
elif [ -z "${BASH_VERSION}" ]; then
# we do not support anything besides bash completion
# (however patches to support other shells are very welcome)
return 100
fi
_cdargs_complete
#!/bin/csh
# (C) 2002-2005 Stefan Kamphausen
# (T)CShell extensions written by
......
......@@ -22,7 +22,7 @@ you can jump to various places throughout the file-system
that are defined using a plain text, line oriented bookmarks file.
.PP
You can create bookmarks by editing your bookmarks file
"$HOME/.cdargs" using your favorite editor, by using the "\-\-add"
"$HOME/.cdargs" using your favorite editor, by using the "--add"
option to
.I cdargs
or by using the built-in mechanism that will be described later.
......@@ -59,7 +59,7 @@ binary somewhere into your path.
Of course you can create functions and/or aliases for different
purposes. You might want to add a \fIpwd\fR call to echo your current
directories or put \-\-nowrap in your functions to enable a different
directories or put --nowrap in your functions to enable a different
scrolling behavior. See section SHELL FUNCTIONS below.
Since version 1.19 cdargs brings a collection of bash functions (and
......@@ -125,7 +125,7 @@ of directories takes place).
If it doesn't match a line, that line won't be displayed.
And to make things even more complicated you can affect this behavior
by using the "\-\-noresolve" option. This option is used when you think
by using the "--noresolve" option. This option is used when you think
you give a \fINeedle\fR which matches descriptions exactly but you don't
want it to be resolved if it does. This option is internally turned on
when you delete an entry (otherwise the deletion of entries until only
......@@ -134,7 +134,7 @@ contains only one entry.
Finally, if the filtered list (but not the bookmarks file) contains
only one entry it is selected and the program exits successfully,
unless you chose \-\-noresolve.
unless you chose --noresolve.
I can only hope that you understand this nested if babble...
......@@ -234,7 +234,7 @@ reports it's result:
function cv () {
.br
cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`"
&& rm \-f "$HOME/.cdargsresult";
&& rm -f "$HOME/.cdargsresult";
.br
}
......@@ -284,22 +284,19 @@ bold font (if the terminal emulation understands that attribute).
.SH "FILES"
.I "/usr/bin/cdargs"
the cdargs executable.
.TP
.I "$HOME/.cdargs"
personal bookmarks file.
.TP
.I "$HOME/.cdargsresult"
temporary file for passing results to shell.
.TP
.I "/usr/share/doc/cdargs/examples/cdargs-bash.sh"
.I "contrib/cdargs-bash.sh"
example collection of bash functions.
.TP
.I "/usr/share/doc/cdargs/examples/cdargs-tcsh.csh"
.I "contrib/cdargs-tcsh.csh"
example collection of tcsh functions.
.TP
.I "/usr/share/emacs/site-lisp/cdargs.el"
.I "contrib/cdargs.el"
(X)Emacs front-end to personal bookmarks file
.SH "REPORTING BUGS"
......@@ -334,4 +331,5 @@ 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/>.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
......@@ -2,7 +2,7 @@ bin_PROGRAMS = cdargs
#AM_CXXFLAGS = -g -ansi -pedantic -Wall -W
#AM_CXXFLAGS = -g -ansi -Wall -W
#AM_CXXFLAGS = -g -Wall -W
AM_CXXFLAGS = -g -Wall -W
# CXXFLAGS = -O2
# EXTRA_DIST = OOREDESIGN
......
......@@ -67,7 +67,7 @@ bin_PROGRAMS = cdargs
#AM_CXXFLAGS = -g -ansi -pedantic -Wall -W
#AM_CXXFLAGS = -g -ansi -Wall -W
#AM_CXXFLAGS = -g -Wall -W
AM_CXXFLAGS = -g -Wall -W
# CXXFLAGS = -O2
# EXTRA_DIST = OOREDESIGN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment