chiark / gitweb /
lib/Odin.pm: Provide substitutions on mail recipient addresses.
[odin-cgi] / bin / pastebin.userv
index c45d4e669ff2cdf4a7f9695ac02b118158bba85c..42dc66d7dc9be1e9cd11ffa29324d94cbaeb4dac 100755 (executable)
@@ -60,13 +60,6 @@ EOF
   $op->bad if @ARGV;
   $op->ok or Odin::fail "usage: new [-l LANG] [-t TITLE]";
   $p{content} = read_content;
-  my $db = Odin::open_db;
-  my $c = "";
-  while (read STDIN, my $buf, 8192) { $c .= $buf; }
-  $p{content} = read_content;
-  @{$db->selectall_arrayref
-    ("SELECT lang FROM odin_pastebin_lang WHERE lang = ?", undef, $p{lang})}
-    or Odin::fail "unknown language `$p{lang}'";
   my ($tag, $edit) = Odin::new_pastebin %p;
   print "$Odin::PASTEBIN/$tag $edit\n";
 } elsif ($op eq "get") {
@@ -97,8 +90,9 @@ EOF
     else { $op->unk; }
   }
   @ARGV = $op->rest;
-  $op->bad if @ARGV;
-  $op->ok or Odin::fail "usage: new [-l LANG] [-t TITLE]";
+  $op->bad if @ARGV != 1;
+  $op->ok or Odin::fail "usage: update [-c] [-l LANG] [-t TITLE] TAG";
+  my $tag = shift @ARGV;
   $p{content} = read_content if $contentp;
   Odin::update_pastebin $tag, undef, %p or Odin::fail "nothing changed";
 } else {