1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-25 10:36:34 -05:00

Allow -x cmdfile as an alternative to @cmdfile options.

This commit is contained in:
Renaud 2015-08-19 15:42:16 +08:00
parent 84bf4de212
commit 02d12c5d84

17
main.c
View File

@ -124,7 +124,7 @@ static void usage( void) {
" +<n> start at line <n>\n" " +<n> start at line <n>\n"
" --help display this help and exit\n" " --help display this help and exit\n"
" --version output version information and exit\n" " --version output version information and exit\n"
" @cmdfile execute command file\n" " @cmdfile execute startup file\n"
" -a|A process error file\n" " -a|A process error file\n"
" -e|E edit file\n" " -e|E edit file\n"
" -g|G<n> go to line <n>\n" " -g|G<n> go to line <n>\n"
@ -134,6 +134,8 @@ static void usage( void) {
" -r|R restrictive use\n" " -r|R restrictive use\n"
" -s|S<string> search string\n" " -s|S<string> search string\n"
" -v|V view file\n" " -v|V view file\n"
" -x|Xcmdfile\n"
" -x|X cmdfile execute command file\n"
, stdout) ; , stdout) ;
} }
@ -253,6 +255,19 @@ int main(int argc, char **argv)
case 'v': /* -v for View File */ case 'v': /* -v for View File */
case 'V': case 'V':
viewflag = TRUE; viewflag = TRUE;
break;
case 'x':
case 'X':
if( argv[ carg][ 2]) { /* -Xfilename */
if( startup( &argv[ carg][ 2]) == TRUE)
startflag = TRUE ; /* don't execute emacs.rc */
} else if( argv[ carg + 1]) { /* -X filename */
if( startup( &argv[ carg + 1][ 0]) == TRUE)
startflag = TRUE ; /* don't execute emacs.rc */
carg += 1 ;
}
break ; break ;
default: /* unknown switch */ default: /* unknown switch */
/* ignore this for now */ /* ignore this for now */