The reason I used 8 spaces is because of being able to tell where the
edge of the terminal was. It's not that important.
Signed-off-by: Gavin Howard <gavin@yzena.com>
This required some work because Windows is stupid with injecting
carriage returns in the text of files where it doesn't exist. I hate
Windows.
Signed-off-by: Gavin Howard <gavin@yzena.com>
This required a lot because one option does not exist depending on the
build type, so I had to change gen/strgen.c and gen/strgen.sh to filter
out just like scripts/manpage.sh does.
In gen/strgen.sh, I just had it reuse the code in scripts/manpage.sh
(moved to scripts/functions.sh). In gen/strgen.c, I had to use custom
code.
But both work, and both get the job done. I have checked the help texts
for both calculators with every build type.
Signed-off-by: Gavin Howard <gavin@yzena.com>
These have the new features: command-line arguments for builtin
variables. They have also fixed a few problems.
Signed-off-by: Gavin Howard <gavin@yzena.com>
This was requested a long time ago, and I rejected it. I see differently
now because the vast majority of my -e invocations are to set these.
Signed-off-by: Gavin Howard <gavin@yzena.com>
This style fixing is to separate out local variables that are pointers
into separate lines, instead of being mashed together. This is an
artifact of the terrible style that was imposed on bc by toybox, but
since I don't maintain that code, I don't care anymore.
Also, I'm trying again to implement automatic code formatting.
Signed-off-by: Gavin Howard <gavin@yzena.com>
It turns out that I *do* have to manually add to the history. Why? I
register the history function with editline, so why do I have to
explicitly call it?
Signed-off-by: Gavin Howard <gavin@yzena.com>
This requires testing for FreeBSD, like I do with OpenBSD. When on
FreeBSD, I have to *not* use _POSIX_C_SOURCE and _XOPEN_SOURCE.
Signed-off-by: Gavin Howard <gavin@yzena.com>
FreeBSD is a pain about defining things. Apparently, it only defines
SIGWINCH if it is not building in a C99 environment, a C11 environment,
or a C89 environment. Seriously?
Signed-off-by: Gavin Howard <gavin@yzena.com>
This was requested by an important FreeBSD user. This was an exploration
of the idea to just use editline and readline. I wasn't sure it was
possible. Turns out, it is.
What is not working: history in editline does not seem to work.
Everything else seems to work. Tests still pass as well.
Signed-off-by: Gavin Howard <gavin@yzena.com>
printf'On FreeBSD. Not using _POSIX_C_SOURCE and _XOPEN_SOURCE.\n\n'
else
history_tests="@printf '\$(TEST_STARS)\\\\n\\\\nRunning history tests...\\\\n\\\\n' \&\& \$(TESTSDIR)/history.sh bc -a \&\& \$(TESTSDIR)/history.sh dc -a \&\& printf '\\\\nAll history tests passed.\\\\n\\\\n\$(TEST_STARS)\\\\n'"
printf'Not on FreeBSD. Using _POSIX_C_SOURCE and _XOPEN_SOURCE.\n\n'