Mercurial > emacs
comparison lib-src/emacsclient.c @ 50101:e5f56d47b52c
(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.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Wed, 12 Mar 2003 21:36:29 +0000 |
parents | c91408365d35 |
children | f49f74eda2e6 |
comparison
equal
deleted
inserted
replaced
50100:ca7aa82d6f39 | 50101:e5f56d47b52c |
---|---|
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 |
5 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
6 | 6 |
7 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
120 case 'e': | 120 case 'e': |
121 eval = 1; | 121 eval = 1; |
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 (0); | |
127 break; | |
128 | |
129 case 'H': | |
130 print_help_and_exit (); | |
131 break; | |
132 | |
133 default: | |
134 fprintf (stderr, "Try `%s --help' for more information\n", progname); | |
126 exit (1); | 135 exit (1); |
127 break; | 136 break; |
128 | |
129 case 'H': | |
130 default: | |
131 print_help_and_exit (); | |
132 } | 137 } |
133 } | 138 } |
134 } | 139 } |
135 | 140 |
136 void | 141 void |
137 print_help_and_exit () | 142 print_help_and_exit () |
138 { | 143 { |
139 fprintf (stderr, | 144 printf ( |
140 "Usage: %s [OPTIONS] FILE...\n\ | 145 "Usage: %s [OPTIONS] FILE...\n\ |
141 Tell the Emacs server to visit the specified files.\n\ | 146 Tell the Emacs server to visit the specified files.\n\ |
142 Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\ | 147 Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\ |
148 \n\ | |
143 The following OPTIONS are accepted:\n\ | 149 The 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\ |
146 -n, --no-wait Don't wait for the server to return\n\ | 152 -n, --no-wait Don't wait for the server to return\n\ |
147 -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ | 153 -e, --eval Evaluate the FILE arguments as ELisp expressions\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\ | |
151 Report bugs to bug-gnu-emacs@gnu.org.\n", progname); | 158 Report 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 & |
156 before each &, each space, each newline, and any initial -. | 163 before each &, each space, each newline, and any initial -. |
157 Change spaces to underscores, too, so that the | 164 Change spaces to underscores, too, so that the |
292 | 299 |
293 /* Process options. */ | 300 /* Process options. */ |
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 |
301 */ | 312 */ |
302 | 313 |