SHORTEN: More reliable; add usage
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 3 Sep 2008 19:29:26 +0000 (19:29 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 3 Sep 2008 19:29:26 +0000 (19:29 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@58 088b83a4-0077-4247-935c-42ec02c2848b

commands.yaml

index ae49473..0bd9951 100644 (file)
@@ -1480,7 +1480,11 @@ SHORTEN: |-
   sub {
     my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
     my( $service, $url ) = split( / /, $what, 2 );
-    if( ! length $url ) {
+    if( !defined( $service ) ) {
+      $kernel->post( $src, $replypath, "USAGE: SHORTEN [<service>] <URL>, where <service> is one of (potentially) BabyURL, Linkz, MakeAShorterLink, Metamark, NotLong, OneShortLink, Shorl, SnipURL*, TinyClick, TinyLink, or TinyURL. (* designates the default service.) Many of these do not work.", $dest );
+      return;
+    }
+    if( !defined( $url ) ) {
       $url = $service;
       $service = "SnipURL";
     }