diff -rcB ./src/files.c ../nano-2.2.2+/src/files.c
*** ./src/files.c 2010-01-14 07:31:21.000000000 +0100
--- ../nano-2.2.2+/src/files.c 2010-02-04 11:55:08.000000000 +0100
***************
*** 128,136 ****
}
#endif
! /* If the filename isn't blank, open the file. Otherwise, treat it
! * as a new file. */
! rc = (filename[0] != '\0') ? open_file(filename, new_buffer, &f) :
-2;
/* If we're loading into a new buffer, add a new entry to
--- 128,136 ----
}
#endif
! /* If the filename isn't blank, and we are not in NOREAD_MODE open the file.
! * Otherwise, treat it as a new file. */
! rc = (filename[0] != '\0' && !ISSET(NOREAD_MODE)) ? open_file(filename, new_buffer, &f) :
-2;
/* If we're loading into a new buffer, add a new entry to
diff -rcB ./src/nano.c ../nano-2.2.2+/src/nano.c
*** ./src/nano.c 2010-01-18 04:42:06.000000000 +0100
--- ../nano-2.2.2+/src/nano.c 2010-02-04 12:00:13.000000000 +0100
***************
*** 893,898 ****
--- 893,899 ----
#ifndef DISABLE_MOUSE
print_opt("-m", "--mouse", N_("Enable the use of the mouse"));
#endif
+ print_opt("-n", "--noread", N_("Do not read the file (write-only)"));
#ifndef DISABLE_OPERATINGDIR
print_opt(_("-o
"), _("--operatingdir="),
N_("Set operating directory"));
***************
*** 2044,2049 ****
--- 2045,2051 ----
#ifndef DISABLE_MOUSE
{"mouse", 0, NULL, 'm'},
#endif
+ {"noread", 0, NULL, 'n'},
#ifndef DISABLE_OPERATINGDIR
{"operatingdir", 1, NULL, 'o'},
#endif
***************
*** 2114,2124 ****
while ((optchr =
#ifdef HAVE_GETOPT_LONG
getopt_long(argc, argv,
! "h?ABC:DEFHIKLNOQ:RST:UVWY:abcdefgijklmo:pqr:s:tuvwxz$",
long_options, NULL)
#else
getopt(argc, argv,
! "h?ABC:DEFHIKLNOQ:RST:UVWY:abcdefgijklmo:pqr:s:tuvwxz$")
#endif
) != -1) {
switch (optchr) {
--- 2116,2126 ----
while ((optchr =
#ifdef HAVE_GETOPT_LONG
getopt_long(argc, argv,
! "h?ABC:DEFHIKLNOQ:RST:UVWY:abcdefgijklmno:pqr:s:tuvwxz$",
long_options, NULL)
#else
getopt(argc, argv,
! "h?ABC:DEFHIKLNOQ:RST:UVWY:abcdefgijklmno:pqr:s:tuvwxz$")
#endif
) != -1) {
switch (optchr) {
***************
*** 2238,2243 ****
--- 2240,2248 ----
SET(USE_MOUSE);
break;
#endif
+ case 'n':
+ SET(NOREAD_MODE);
+ break;
#ifndef DISABLE_OPERATINGDIR
case 'o':
operating_dir = mallocstrcpy(operating_dir, optarg);
diff -rcB ./src/nano.h ../nano-2.2.2+/src/nano.h
*** ./src/nano.h 2009-12-02 04:36:42.000000000 +0100
--- ../nano-2.2.2+/src/nano.h 2010-02-04 11:54:03.000000000 +0100
***************
*** 494,500 ****
BOLD_TEXT,
QUIET,
UNDOABLE,
! SOFTWRAP
};
/* Flags for which menus in which a given function should be present */
--- 494,501 ----
BOLD_TEXT,
QUIET,
UNDOABLE,
! SOFTWRAP,
! NOREAD_MODE
};
/* Flags for which menus in which a given function should be present */