]> the.earth.li Git - htag.git/blobdiff - plugins/25asktag
Import Upstream version 0.0.23
[htag.git] / plugins / 25asktag
index 8ee45f6d4f02bab3cf7c3102f99bdbf6107adab9..ef8339d280903350c3c2a4ce31ae04b0a3314aab 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Copyright (C) 2000-2001 Simon Huggins
+# Copyright (C) 2000-2003 Simon Huggins
 # asktag chooses a tag like catsig chooses a sig.
 
 # This program is free software; you can redistribute it and/or modify it
@@ -20,6 +20,7 @@
 use strict;
 
 return if $cfg{'notag'};
+return unless $cfg{'asktag'};
 
 open(SIG, "<$cfg{'tmpsigfile'}") or htagdie "$0: Could not open $cfg{'tmpsigfile'}: $!\n";
 my @sig=<SIG>;
@@ -27,10 +28,11 @@ close(SIG);
 
 chomp $sig[-1];
 print STDERR @sig;
-print STDERR "\n\nOK? ([Y]es/(n)ew Tag/(q)uit)\n";
+print STDERR "\n\nOK? ([Y]es/(n)ew Tag/(b)ack to start/(q)uit)\n";
 $_ = <STDIN>;
-return 255 if /^q(?:uit)?/i;
-return     if /^(?:y(?:es)?|\n)/i;
+return 255     if /^q(?:uit)?/i;
+return 2       if /^b(?:ack)?/i;
+return         if /^(?:y(?:es)?|\n)/i;
 
 # Remove sig, and copy old sig (unmerged copy) back over the top
 unlink($cfg{'tmpsigfile'}) or htagdie "Could not remove $cfg{'tmpsigfile'}: $!\n";