Dolda2000 GitWeb
/
utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2dcf548
)
anndata: Added option for browsing to the current directory's name.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 10 Mar 2011 18:12:04 +0000
(19:12 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 10 Mar 2011 18:12:04 +0000
(19:12 +0100)
anndata
patch
|
blob
|
blame
|
history
diff --git
a/anndata
b/anndata
index
5a91e5a
..
7ed3e13
100755
(executable)
--- a/
anndata
+++ b/
anndata
@@
-4,7
+4,7
@@
use Getopt::Long;
use Anime::ANN;
binmode STDOUT, ":utf8";
use Anime::ANN;
binmode STDOUT, ":utf8";
-GetOptions(\%options, "l=s", "b=s") || exit 1;
+GetOptions(\%options, "l=s", "b=s"
, "d"
) || exit 1;
if($options{"l"}) {
@list = Anime::ANN::getlist($options{"l"});
if($options{"l"}) {
@list = Anime::ANN::getlist($options{"l"});
@@
-14,12
+14,18
@@
if($options{"l"}) {
exit 0;
}
exit 0;
}
+$browse = "";
if($options{"b"}) {
if($options{"b"}) {
- $id = Anime::ANN::getid $options{"b"};
+ $browse = $options{"b"};
+} elsif($options{"d"}) {
+ $browse = `basename "\$(pwd)"`;
+}
+if($browse) {
+ $id = Anime::ANN::getid $browse;
if(defined($id)) {
exec "htmlview", Anime::ANN::geturl($id);
} else {
if(defined($id)) {
exec "htmlview", Anime::ANN::geturl($id);
} else {
- printf STDERR "could not find " . $
options{"b"}
. "\n";
+ printf STDERR "could not find " . $
browse
. "\n";
exit 1;
}
}
exit 1;
}
}