changeset 4242:cf19d8102b34

[gaim-migrate @ 4492] John B. Silvestri (silvestrij) writes: "This adds a --longhelp (-H) option to gaim-remote, which details its usage (aim?goim,gochat, and addbuddy)." he further writes: "Now follows Sean's request of being `gaim-remote -h uri` or `gaim-remote --help uri` This is version 3.11.\n"), name); luke writes that this patch is needed because _i_ can't remember how to use the gaim-remote stuff, much less help others to do so, and what use is a gaim-remote that only 2 people know how to use? committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 08 Jan 2003 04:00:29 +0000
parents cc14954cc399
children eae97ca4bbea
files src/gaim-remote.c
diffstat 1 files changed, 47 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaim-remote.c	Wed Jan 08 03:57:17 2003 +0000
+++ b/src/gaim-remote.c	Wed Jan 08 04:00:29 2003 +0000
@@ -2,6 +2,8 @@
  * gaim-remote
  *
  * Copyright (C) 2002, Sean Egan <bj91704@binghamton.edu>
+ * Features/functionality added (C) 2002, John B. Silvestri <silvestrij@mville.edu>
+ *	'quit', long help for URIs
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,12 +27,20 @@
 #include <string.h>
 #include "gaim-socket.h"
 
-void show_remote_usage(char *name) 
+void show_remote_usage(char *name)
 {
 	printf(_("Usage: %s command [OPTIONS] [URI]\n\n"
-		 
+
 	     "    COMMANDS:\n"
-	     "       uri                      Handle AIM:// URI\n"
+	     "       uri                      Handle AIM: URI\n"
+	     "       quit                     Close running copy of Gaim\n\n"
+
+	     "    OPTIONS:\n"
+	     "       -h, --help [commmand]    Show help for command\n"), name);
+	return;
+}
+
+/*To be implemented:
 	     "       info                     Show information about connected accounts\n"
 	     "       list                     Print buddy list\n"
 	     "       ison                     Show presence state of your buddy\n"
@@ -38,18 +48,13 @@
 	     "       send                     Send message\n"
 	     "       add                      Add buddy to buddy list\n"
 	     "       remove                   Remove buddy from list\n"
-	     "       quit                     Close running copy of Gaim\n\n"
-		 
-	     "    OPTIONS:\n"
 	     "       -m, --message=MESG       Message to send or show in conversation window\n"
 	     "       -t, --to=SCREENNAME      Select a target for command\n"
 	     "       -p, --protocol=PROTO     Specify protocol to use\n"
 	     "       -f, --from=SCREENNAME    Specify screenname to use\n"
-	     "       -q, --quiet              Send message without showing a conversation\n" 
+	     "       -q, --quiet              Send message without showing a conversation\n"
 	     "                                window\n"
-	     "       -h, --help               Show help for command\n"), name);
-	return;
-}
+*/
 
 static struct option longopts[] = {
 	{"message", required_argument, NULL, 'm'},
@@ -153,10 +158,34 @@
 	return 0;
 }
 
+void show_longhelp_uri(){
+	printf ("\n"
+
+	"Using AIM: URIs:\n"
+	"Sending an IM to a screenname:\n"
+	"	gaim-remote uri 'aim:goim?screenname=Penguin&message=hello+world'\n"
+	"In this case, 'Penguin' is the screenname we wish to IM, and 'hello world'\n"
+	"is the message to be sent.  '+' must be used in place of spaces.\n"
+	"Please note the quoting used above - if you run this from a shell the '&'\n"
+	"needs to be escaped, or the command will stop at that point.\n"
+	"Also,the following will just open a conversation window to a screenname,\n"
+	"with no message:\n"
+	"	gaim-remote uri aim:goim?screenname=Penguin\n\n"
+	"Joining a chat:\n"
+	"	gaim-remote uri aim:gochat?roomname=PenguinLounge\n"
+	"...joins the 'PenguinLounge' chat room.\n\n"
+	"Adding a buddy to your buddy list:\n"
+	"	gaim-remote uri aim:addbuddy?screenname=Penguin\n"
+	"...prompts you to add 'Penguin' to your buddy list.\n"
+	);
+	return;
+}
+
+/* Work in progress - JBS
 int command_info(){
 	fprintf(stderr, "Info not yet implemented\n");
     return 1;
-}
+}*/
 
 int main (int argc, char *argv[])
 {
@@ -168,9 +197,13 @@
 	
 	
 	if (!strcmp(opts.command, "uri")) {
-		return command_uri();
-	} else if (!strcmp(opts.command, "info")) {
-		return command_info();
+		if(opts.help){
+			show_longhelp_uri();
+		}else{
+			return command_uri();
+		}
+/*	} else if (!strcmp(opts.command, "info")) {
+		return command_info();*/
 	} else if (!strcmp(opts.command, "quit")) {
 		return command_quit();
 	} else {