Mercurial > repo
annotate bin/whoq @ 11591:8d0288361b28 draft
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
author | HackEso <hackeso@esolangs.org> |
---|---|
date | Wed, 08 Aug 2018 13:49:39 +0000 |
parents | |
children | eb873414aa9c |
rev | line source |
---|---|
11591
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
1 if [[ "$1" =~ "^[0-9]*$" ]]; then |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
2 rev="$(hg blame quotes | sed "$1{s/^ *//;s/:.*//;q};d")" |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
3 if [[ -n "$rev" ]]; then |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
4 hg log -r "$rev" -T "{desc}" |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
5 else |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
6 echo "$1: no such quote" |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
7 fi |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
8 else |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
9 echo "usage: `whoq N" |
8d0288361b28
<fizzie> fetch bin/whoq https://hack.esolangs.org/get/bin/whoq
HackEso <hackeso@esolangs.org>
parents:
diff
changeset
|
10 fi |