4 ms·
The alias file is indeed overwritten on every invocation, but tag doesn't attempt to clean up stale aliases from previous invocations. I figured it wasn't reall
by aykamko 10y ago
The alias file is indeed overwritten on every invocation, but tag doesn't attempt to clean up stale aliases from previous invocations. I figured it wasn't really worth implementing this since, as far as I know, shells don't slow down from having "too many aliases".
- abglassman 10y agotag is very cool, but please don't implement the shortcuts with shell aliases: ~/badcode$ echo "func" > badfile.go\;\ echo\ \"Gotcha\!\" ~/badcode$ ls badfile.go; echo "Gotcha!" ~/badcode$ tag func badfile.go; echo "Gotcha!" [1] 1:func ~/badcode$ e1 Gotcha! +1 In case that's not clear, I was able to create a file with a name that contains potentially malicious shell commands that is now bound to an alias via tag. Other ways to implement the shortcuts: create a flag or subcommand to look up an hit from the results file and jump to it (I can alias this command to suit my taste) or prompt me for input before returning to the command line.