1 |
/* Client process that communicates with GNU Emacs acting as server. |
/* Client process that communicates with GNU Emacs acting as server. |
2 |
Copyright (C) 1986, 1987, 1994, 1999, 2000, 2001 |
Copyright (C) 1986, 1987, 1994, 1999, 2000, 2001, 2003 |
3 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Emacs. |
This file is part of GNU Emacs. |
122 |
break; |
break; |
123 |
|
|
124 |
case 'V': |
case 'V': |
125 |
fprintf (stderr, "emacsclient %s\n", VERSION); |
printf ("emacsclient %s\n", VERSION); |
126 |
exit (1); |
exit (0); |
127 |
break; |
break; |
128 |
|
|
129 |
case 'H': |
case 'H': |
|
default: |
|
130 |
print_help_and_exit (); |
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; |
137 |
} |
} |
138 |
} |
} |
139 |
} |
} |
141 |
void |
void |
142 |
print_help_and_exit () |
print_help_and_exit () |
143 |
{ |
{ |
144 |
fprintf (stderr, |
printf ( |
145 |
"Usage: %s [OPTIONS] FILE...\n\ |
"Usage: %s [OPTIONS] FILE...\n\ |
146 |
Tell the Emacs server to visit the specified files.\n\ |
Tell the Emacs server to visit the specified files.\n\ |
147 |
Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\ |
Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\ |
148 |
|
\n\ |
149 |
The following OPTIONS are accepted:\n\ |
The following OPTIONS are accepted:\n\ |
150 |
-V, --version Just print a version info and return\n\ |
-V, --version Just print a version info and return\n\ |
151 |
-H, --help Print this usage information message\n\ |
-H, --help Print this usage information message\n\ |
154 |
-d, --display=DISPLAY Visit the file in the given display\n\ |
-d, --display=DISPLAY Visit the file in the given display\n\ |
155 |
-a, --alternate-editor=EDITOR\n\ |
-a, --alternate-editor=EDITOR\n\ |
156 |
Editor to fallback to if the server is not running\n\ |
Editor to fallback to if the server is not running\n\ |
157 |
|
\n\ |
158 |
Report bugs to bug-gnu-emacs@gnu.org.\n", progname); |
Report bugs to bug-gnu-emacs@gnu.org.\n", progname); |
159 |
exit (1); |
exit (0); |
160 |
} |
} |
161 |
|
|
162 |
/* Return a copy of NAME, inserting a & |
/* Return a copy of NAME, inserting a & |
301 |
decode_options (argc, argv); |
decode_options (argc, argv); |
302 |
|
|
303 |
if (argc - optind < 1) |
if (argc - optind < 1) |
304 |
print_help_and_exit (); |
{ |
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 |
|
} |
309 |
|
|
310 |
/* |
/* |
311 |
* Open up an AF_UNIX socket in this person's home directory |
* Open up an AF_UNIX socket in this person's home directory |