Skip to content

Commit

Permalink
Tweaks to -c / -C behavior and documentation.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey H. Johnson <[email protected]>
  • Loading branch information
johnsonjh committed Apr 1, 2024
1 parent 2630d06 commit 6954e54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions common/exf.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ file_cinit(SCR *sp)
"-C option", gp->C_option, strlen(gp->C_option), 1, 1))
return;
gp->C_option = NULL;
gp->c_option = NULL;
} else if (gp->c_option != NULL && !F_ISSET(sp->frp, FR_NEWFILE)) {
if (db_last(sp, &sp->lno))
return;
Expand Down
8 changes: 4 additions & 4 deletions common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ editor(GS *gp, int argc, char *argv[])
* Should we support multiple -C options?
*/

if (gp->C_option != NULL) {
openbsd_warnx("only one -C command may be specified.");
if (gp->c_option != NULL || gp->C_option != NULL) {
openbsd_warnx("only one -c or -C command may be specified.");
return (1);
}
gp->C_option = openbsd_optarg;
Expand All @@ -180,8 +180,8 @@ editor(GS *gp, int argc, char *argv[])
* We should support multiple -c options.
*/

if (gp->c_option != NULL) {
openbsd_warnx("only one -c command may be specified.");
if (gp->C_option != NULL || gp->c_option != NULL) {
openbsd_warnx("only one -c or -C command may be specified.");
return (1);
}
gp->c_option = openbsd_optarg;
Expand Down
5 changes: 2 additions & 3 deletions docs/USD.doc/vi.man/vi.1
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ This is the POSIX 1003.2 interface for the historic
syntax.
.Nm oex Ns / Ns Nm ovi
supports both the old and new syntax. This option is mutally
exclusive with "-C"; if both are specified, "-C" takes precedence.
exclusive with "-C".
.It Fl C Ar cmd
Execute
.Ar cmd
Expand All @@ -113,8 +113,7 @@ from the
.Pa $HOME/.nexrc
or
.Pa $HOME/.exrc
files. This option is mutually exclusive with "-c"; if both are
specified, this option takes precedence.
files. This option is mutually exclusive with "-c".
.It Fl e
Start editing in ex mode, as if the command name were
.Nm ex .
Expand Down

0 comments on commit 6954e54

Please sign in to comment.