From d8a3bf2bf8c6783432f2ad3fd1e6c23113d455ed Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 18 Jan 2024 13:08:29 -0800 Subject: README: add section listing advantages. --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index f447c92..b6004b3 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,33 @@ is `/etc` and `c1` holds `/var`, then `cdlog.chdir /var` will change to `/var` and just replace `c1` with `/etc`, without rotating through the FIFO entries `c2` through `c9`. +## How is this better? + +* It's not hard-coded C code inside the shell; it consists of a small amount of +code whose behavior that can be customized by the end-user. + +* Uses simple variables, which are better supported for completion +and require fewer keystrokes. + +* The `dirs` command for accessing the directory stack in Bash is too +clumsy and won't be discussed here any more. + +* Bash's shorthand notation for accessing the nth element, namely `~-n`, takes +more keystrokes than `cdlog`'s aliases for the first four elements, `$x` +through `$w`. + +* Bash's shorthand notation requires an explicit slash to be typed +in order for completion to work. `~-n` followed by tab is not sufficient. +You must type a slash and then Tab. Whereas completing on the variable `$x` +just requires Tab. One tab will automatically add the slash and then additional +tabs engage further completion. + +* Bash's `direxpand` option does not work for `~-n` notation. Completion +works, but the notation remains unexpanded. + +* Most of `cdlog` is portable to other shells. All that is nonportable +in the code is the use of `local`, and the `shopt -o direxpand` command. + ## License This is under distributed under a modified two-clause BSD license. -- cgit v1.2.3