aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-15 13:56:57 +0000
committerRichard M. Stallman1994-12-15 13:56:57 +0000
commit1702afef39488e54d8f7fba0ad009095bfc703d2 (patch)
tree6c884c0aca0285832f7057aaebec6c4efd430e6c
parentdcc98b56bc01b817688a235bf8909b344f102720 (diff)
downloademacs-1702afef39488e54d8f7fba0ad009095bfc703d2.tar.gz
emacs-1702afef39488e54d8f7fba0ad009095bfc703d2.zip
(main): Fix conversion of --display to -d.
(main): Implement --version.
-rw-r--r--src/emacs.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 6172297bc3e..290b1675876 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -420,6 +420,22 @@ main (argc, argv, envp)
420 420
421 sort_args (argc, argv); 421 sort_args (argc, argv);
422 422
423 if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args))
424 {
425 Lisp_Object tem;
426 tem = Fsymbol_value (intern ("emacs-version"));
427 if (!STRINGP (tem))
428 {
429 fprintf (stderr, "Invalid value of `emacs-version'\n");
430 exit (1);
431 }
432 else
433 {
434 printf ("%s\n", XSTRING (tem)->data);
435 exit (0);
436 }
437 }
438
423/* Map in shared memory, if we are using that. */ 439/* Map in shared memory, if we are using that. */
424#ifdef HAVE_SHM 440#ifdef HAVE_SHM
425 if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args)) 441 if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args))
@@ -604,7 +620,9 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\
604 argv = new; 620 argv = new;
605 argc++; 621 argc++;
606 } 622 }
607 else if (displayname != 0 && argv[count_before + 1][1] == '-') 623 /* Change --display to -d, when its arg is separate. */
624 else if (displayname != 0 && skip_args > count_before
625 && argv[count_before + 1][1] == '-')
608 argv[count_before] = "-d"; 626 argv[count_before] = "-d";
609 627
610 /* Don't actually discard this arg. */ 628 /* Don't actually discard this arg. */