1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-11-19 19:15:55 -05:00

uemacs: Add --version option.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Thiago Farina 2010-08-13 00:19:22 -03:00 committed by Linus Torvalds
parent 1f271323f8
commit dfc102ce3a

34
main.c
View File

@ -1,14 +1,16 @@
/* /*
* main.c
* uEmacs/PK 4.0 * uEmacs/PK 4.0
* *
* based on * Based on:
* *
* MicroEMACS 3.9 * MicroEMACS 3.9
* written by Dave G. Conroy. * Written by Dave G. Conroy.
* substatially modified by Daniel M. Lawrence * Substatially modified by Daniel M. Lawrence
* modified by Petri Kutvonen * Modified by Petri Kutvonen
* *
* MicroEMACS 3.9 (C)opyright 1987 by Daniel M. Lawrence * MicroEMACS 3.9 (c) Copyright 1987 by Daniel M. Lawrence
* *
* Original statement of copying policy: * Original statement of copying policy:
* *
@ -18,8 +20,6 @@
* *
* No copyright claimed for modifications made by Petri Kutvonen. * No copyright claimed for modifications made by Petri Kutvonen.
* *
* MAIN.C
*
* This file contains the main driving routine, and some keyboard * This file contains the main driving routine, and some keyboard
* processing code. * processing code.
* *
@ -53,16 +53,15 @@
#include <stdio.h> #include <stdio.h>
/* make global definitions not external */ /* Make global definitions not external. */
#define maindef #define maindef
#include "estruct.h" /* global structures and defines */ #include "estruct.h" /* Global structures and defines. */
#include "edef.h" /* global definitions */ #include "edef.h" /* Global definitions. */
#include "efunc.h" /* function declarations and name table */ #include "efunc.h" /* Function declarations and name table. */
#include "ebind.h" /* default key bindings */ #include "ebind.h" /* Default key bindings. */
/* for MSDOS, increase the default stack space */
/* For MSDOS, increase the default stack space. */
#if MSDOS & TURBO #if MSDOS & TURBO
#if PKCODE #if PKCODE
extern unsigned _stklen = 20000; extern unsigned _stklen = 20000;
@ -130,6 +129,12 @@ int main(int argc, char **argv)
signal(SIGWINCH, sizesignal); signal(SIGWINCH, sizesignal);
#endif #endif
#endif #endif
if (argc == 2) {
if (!strcmp(argv[1], "--version")) {
printf("%s version %s\n", PROGNAME, VERSION);
exit(EXIT_SUCCESS);
}
}
/* initialize the editor */ /* initialize the editor */
vtinit(); /* Display */ vtinit(); /* Display */
@ -151,7 +156,6 @@ int main(int argc, char **argv)
/* Parse the command line */ /* Parse the command line */
for (carg = 1; carg < argc; ++carg) { for (carg = 1; carg < argc; ++carg) {
/* Process Switches */ /* Process Switches */
#if PKCODE #if PKCODE
if (argv[carg][0] == '+') { if (argv[carg][0] == '+') {