rakitzis / rc

rc shell -- independent re-implementation for Unix of the Plan 9 shell (from circa 1992)
Other
250 stars 23 forks source link

Add option to report an error if user accesses undefined variable like bash 'set -u' #76

Open birchb1024 opened 2 years ago

birchb1024 commented 2 years ago

Undefined variables or misspelled variables are a common source of bugs. When coding in bash, I always set -u. Really want this in rc. Suggest:

flag u [+|-]

To paraphrase bash:

Treat unset variables other than the special ‘*’ as an error when performing
variable expansion. An error message will be written to the standard error,
and a non-interactive shell will exit.