Show HN: Teleport: Simple command line app tutorial written in Haskell
bollu.github.io
bollu.github.io
# mark/jump support + completion
# un/mark name : bookmark a directory or remove one (unmark)
# jump name : jump to directory
# marks : show all bookmarks
export MARKPATH=$HOME/.marks
function jump {
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
}
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- | sed 's/ -/\t-/g' && echo
}
_completemarks() {
local curw=${COMP_WORDS[COMP_CWORD]}
local wordlist=$(find $MARKPATH -type l -printf "%f\n")
COMPREPLY=($(compgen -W '${wordlist[@]}' -- "$curw"))
return 0
}
complete -F _completemarks jump unmarkI'm glad you liked it :)
cd -
Which goes back to the previous directly I was just on. They have the same thing for git as well: git checkout -
it's quite handy for switching back and forth between branches or directories!On the other hand, teleport seems to actually provide a much better UX than pushd/popd:
1. it's a hash-table not a stack (directories are named), so it allows random access to memorized directories.
2. it is possible to display the current state.
3. remembered directories are persistent between shell sessions.
Regardless, pushd/popd/dirs is a tough experience. Seems capable of a lot, but I only use it for bouncing between two directories, typically.
The tool I like, but can't remember the name of is basically 'cd ${PWD:src/tst}'. Only, a little more terse.
Haven't used it in a while either, since I've primarily switched to eshell.
I definitely use aliases for multiple frequently accessed directories.
`kdev` takes me to my work dev folder, `wpdev` takes me to my wordpress folder, etc.
But I definitely see the points parent comment to yours made.
And yes, the primary goal of writing this was to have a small CLI app in Haskell, but I've found that I use teleport a decent amount now to quickly zip between common folders
Meant to clarify, I was not defending pushd/popd. It is a tough experience. Not a tough experience to beat. And pedagogical is a perfectly fine motivation.
2. the goal of the tool was to be minimal, useful, and a way to show off Haskell's ability to be able to write real world code that beginners can understand.
3. (personal opinion) Haskell is way more maintainable than bash is, any day of the week.
The link that has been originally posted is a CLI based tool which has nothing to do with website mirroring.
First, this is a clearly a trademark issue, not a copyright issue. You can't copyright a name. In fact there are many, many, many things that you can't copyright. It often happens that people conflate the 3 main areas of intellectual property law: copyright, trademarks and patents, but it is quite important that you distinguish between them precisely.
WRT to trademarks, having a similar name is not enough to cause a trademark infringement. It also needs to create confusion in the marketplace. In this case, a tutorial on how to make a command line Haskell app and some kind of web service is really unlikely to cause any confusion.
The problem with trademarks is that, unlike copyright, if you have a trademark you have to defend it or lose it. So if you sue someone over a trademark infringement, the other side can say, "Well, they didn't say anything about this other guy doing the same thing even though they knew about it". This can cause you to lose the trademark.
Because of this, many lawyers err on the side of caution and send out spammy "You are infringing on our trademark" notices to everyone. If you send a quick note back saying, "I don't think there is any possibility of confusion in the market place" (such as this situation), the lawyers will often back off -- unless they truly believe that there is a problem.
Clearly your advice of trying to avoid trademark infringement is good advice. In this case, though, here is pretty clearly no infringement, so it's misplaced. In the very unlikely even that a lawyer asks about it, replying back with the response, "There is no chance for confusion in the market place" will likely be enough (Note: this is not legal advice, and I am not a lawyer).
Interesting side track: The World Wrestling Federation (WWF) became World Wrestling Enterprises (WWE) due to a trademark dispute with the World Wildlife Foundation (WWF). You could reasonably think that there is no way of confusion in the market place, but the World Wildlife Foundation showed that people were hesitant to contribute to them because they actually thought that they were associated with the World Wrestling Federation. That is the key issue, not just the similarity in the name.