aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2003-03-12 21:36:29 +0000
committerJuanma Barranquero2003-03-12 21:36:29 +0000
commit20c396e841fd27dafa8deea9680d83e109e7a698 (patch)
treea80b92144357c2aadbc95a5070cc1619ed8231a8
parent7df58a0ded887b06be20a76d69a9ff9b9413338e (diff)
downloademacs-20c396e841fd27dafa8deea9680d83e109e7a698.tar.gz
emacs-20c396e841fd27dafa8deea9680d83e109e7a698.zip
(print_help_and_exit): Print to stdout. Exit successfully. Added some blank
lines for readability. (decode_options): Don't call print_help_and_exit in default case. Print version information to stdout. (main): Don't call print_help_and_exit.
-rw-r--r--lib-src/emacsclient.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 9a4a974c946..3f154a2c325 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1,5 +1,5 @@
1/* Client process that communicates with GNU Emacs acting as server. 1/* Client process that communicates with GNU Emacs acting as server.
2 Copyright (C) 1986, 1987, 1994, 1999, 2000, 2001 2 Copyright (C) 1986, 1987, 1994, 1999, 2000, 2001, 2003
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -122,13 +122,18 @@ decode_options (argc, argv)
122 break; 122 break;
123 123
124 case 'V': 124 case 'V':
125 fprintf (stderr, "emacsclient %s\n", VERSION); 125 printf ("emacsclient %s\n", VERSION);
126 exit (1); 126 exit (0);
127 break; 127 break;
128 128
129 case 'H': 129 case 'H':
130 default:
131 print_help_and_exit (); 130 print_help_and_exit ();
131 break;
132
133 default:
134 fprintf (stderr, "Try `%s --help' for more information\n", progname);
135 exit (1);
136 break;
132 } 137 }
133 } 138 }
134} 139}
@@ -136,10 +141,11 @@ decode_options (argc, argv)
136void 141void
137print_help_and_exit () 142print_help_and_exit ()
138{ 143{
139 fprintf (stderr, 144 printf (
140 "Usage: %s [OPTIONS] FILE...\n\ 145 "Usage: %s [OPTIONS] FILE...\n\
141Tell the Emacs server to visit the specified files.\n\ 146Tell the Emacs server to visit the specified files.\n\
142Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\ 147Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\
148\n\
143The following OPTIONS are accepted:\n\ 149The following OPTIONS are accepted:\n\
144-V, --version Just print a version info and return\n\ 150-V, --version Just print a version info and return\n\
145-H, --help Print this usage information message\n\ 151-H, --help Print this usage information message\n\
@@ -148,8 +154,9 @@ The following OPTIONS are accepted:\n\
148-d, --display=DISPLAY Visit the file in the given display\n\ 154-d, --display=DISPLAY Visit the file in the given display\n\
149-a, --alternate-editor=EDITOR\n\ 155-a, --alternate-editor=EDITOR\n\
150 Editor to fallback to if the server is not running\n\ 156 Editor to fallback to if the server is not running\n\
157\n\
151Report bugs to bug-gnu-emacs@gnu.org.\n", progname); 158Report bugs to bug-gnu-emacs@gnu.org.\n", progname);
152 exit (1); 159 exit (0);
153} 160}
154 161
155/* Return a copy of NAME, inserting a & 162/* Return a copy of NAME, inserting a &
@@ -294,7 +301,11 @@ main (argc, argv)
294 decode_options (argc, argv); 301 decode_options (argc, argv);
295 302
296 if (argc - optind < 1) 303 if (argc - optind < 1)
297 print_help_and_exit (); 304 {
305 fprintf (stderr, "%s: file name or argument required\n", progname);
306 fprintf (stderr, "Try `%s --help' for more information\n", progname);
307 exit (1);
308 }
298 309
299 /* 310 /*
300 * Open up an AF_UNIX socket in this person's home directory 311 * Open up an AF_UNIX socket in this person's home directory