Skip to content

Commit

Permalink
Update documentation and error messages for -P change
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnoKing committed Feb 15, 2024
1 parent a473068 commit c04159d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/cmd/ksh93/bltins/typeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ int b_typeset(int argc,char *argv[],Shbltin_t *context)
}
if((flag&NV_REF) && (flag&~(NV_REF|NV_IDENT|NV_ASSIGN|NV_SCOPES)))
{
errormsg(SH_DICT,2,e_optincompat2,"-n","other options except -c, -D and -g");
errormsg(SH_DICT,2,e_optincompat2,"-n","other options except -P, -D and -g");
error_info.errors++;
}
if((flag&NV_TYPE) && (flag&~(NV_TYPE|NV_VARNAME|NV_ASSIGN)))
Expand Down Expand Up @@ -522,12 +522,12 @@ int b_typeset(int argc,char *argv[],Shbltin_t *context)
}
if((flag&NV_SCOPES) && sh.mktype)
{
errormsg(SH_DICT,ERROR_exit(2),"type members cannot use the scoping flags -c, -D and -g");
errormsg(SH_DICT,ERROR_exit(2),"type members cannot use the scoping flags -P, -D and -g");
UNREACHABLE();
}
if(scoping_flags > 1)
{
errormsg(SH_DICT,ERROR_exit(2),"the scoping flags -c, -D and -g cannot be combined");
errormsg(SH_DICT,ERROR_exit(2),"the scoping flags -P, -D and -g cannot be combined");
UNREACHABLE();
}
if(troot==sh.var_tree && !sh.mktype && sh.infunction && !(flag&(NV_SCOPES)))
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/data/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ const char sh_opttypeset[] =
"[p?Causes the output to be in a format that can be used as input to the "
"shell to recreate the attributes for variables. If this flag "
"is used by \btypeset\b in a POSIX function without also passing "
"\b-D\b or \b-c\b, the local scope is ignored and \btypeset\b will "
"\b-D\b or \b-P\b, the local scope is ignored and \btypeset\b will "
"only use the global scope.]"
"[r?Enables readonly. Once enabled it cannot be disabled. See "
"\breadonly\b(1).]"
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/ksh93/sh.1
Original file line number Diff line number Diff line change
Expand Up @@ -8485,7 +8485,7 @@ for infinite loops.
The same as
.BR whence\ \-v .
.TP
\(dg\(dd \f3typeset\fP \*(OK \f3\(+-ACDHSbcfglmnprstux\^\fP \*(CK \*(OK \f3\(+-EFLRXZi\*(OK\f2n\^\fP\*(CK \*(CK \*(OK \f3\+-M \*(OK \f2mapname\fP \*(CK \*(CK \*(OK \f3\-T \*(OK \f2tname\fP=(\f2assign_list\fP) \*(CK \*(CK \*(OK \f3\-h \f2str\fP \*(CK \*(OK \f3\-a\fP \*(OK \f2\*(OKtype\*(CK\fP \*(CK \*(CK \*(OK \f2vname\^\fP\*(OK\f3=\fP\f2value\^\fP \*(CK \^ \*(CK .\|.\|.
\(dg\(dd \f3typeset\fP \*(OK \f3\(+-ACDHPSbfglmnprstux\^\fP \*(CK \*(OK \f3\(+-EFLRXZi\*(OK\f2n\^\fP\*(CK \*(CK \*(OK \f3\+-M \*(OK \f2mapname\fP \*(CK \*(CK \*(OK \f3\-T \*(OK \f2tname\fP=(\f2assign_list\fP) \*(CK \*(CK \*(OK \f3\-h \f2str\fP \*(CK \*(OK \f3\-a\fP \*(OK \f2\*(OKtype\*(CK\fP \*(CK \*(CK \*(OK \f2vname\^\fP\*(OK\f3=\fP\f2value\^\fP \*(CK \^ \*(CK .\|.\|.
Sets attributes and values for shell variables and functions.
When invoked inside a function defined with the
.B function
Expand Down Expand Up @@ -8735,7 +8735,7 @@ above) or in a name space (see
.I Name Spaces\^
above).
.TP
.B \-c
.B \-P
Forces variables to be created or modified using static local
scoping, even when
.B typeset
Expand Down

0 comments on commit c04159d

Please sign in to comment.