Looks fully featured! Cool stuff.
I think people are going to ask "Why?" and "What's the difference between this and bash?" Might want to cover that in your README.
I think people are going to ask "Why?" and "What's the difference between this and bash?" Might want to cover that in your README.
I don't think this is anything more than a toy to play with rust.
For example:
export MARKPATH=$HOME/.marks
function jump {
cd -P $MARKPATH/$1 2> /dev/null || (echo "No such mark: $1" && marks)
}
function mark {
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function unmark {
rm -i $MARKPATH/$1
}
function marks {
ls -l $MARKPATH | sed 's/ / /g' | cut -d' ' -f9- && echo
}
_jump()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$( ls $MARKPATH )" -- $cur) )
}
complete -F _jump jump
This would be much harder to do in a script.Me too. Looking at them, they all start with something like
test $# -eq 2 || return
...since in sh/bash you cannot even name your function's arguments or indicate how many you expect to receive.Speaking of primitiveness, in strict POSIX sh, there's no such thing as local variables in functions!!
I would probably use Python, Go or Powershell.
http://users.eecs.northwestern.edu/~jesse/pubs/caml-shcaml/
Incidentally, that would also dramatically decreased security and maintainability problems.