open
https://gitlab.synchro.net/main/sbbs/-/work_items/1328
## Idea
Add a help menu file for Access Requirement String (ARS) prompts in the Terminal Server, reachable by typing `?` at the prompt, the same way `text/menu/textsrch.msg` is shown from the boolean text-search prompts (`get_search_string()` in `prntfile.cpp`).
ARS is used rarely enough at a terminal prompt that the details are easy to forget: a bare number means `LEVEL`, `!` versus `NOT`, which keywords take `=`, the `FLAG1`..`FLAG4` letters, the keyword abbreviations, `EXEMPT`/`REST` spelling, and so on. A one-screen cheat sheet would save a trip to the wiki (`access:requirements`).
## Where ARS is prompted for today
Only two places in the Terminal Server read an ARS from the user:
1. `src/sbbs3/useredit.cpp` - the `/` command of the online user editor (ARS-match search). This is the only user of the `UeditARSearchPrompt` text.dat string ("AR string to search for:").
2. `exec/str_cmds.js` - the `BULKMAIL` sysop command. Its prompt ("Enter ARS matches to send mail to or [CR] to send by name/number / ARS to match:") is hard-coded English, so it is neither sysop-customizable nor translatable.
(`exec/bulkmail.js`, the command-line bulk mailer for jsexec, has the same hard-coded prompt, but it has no `bbs` object and is out of scope.)
## Proposed solution
- New menu file `text/menu/ars.msg` (name open), laid out like `textsrch.msg`: the dozen common keywords, the comparison and connective operators (`=`, `!`/`NOT`, `AND`/`&`, `OR`/`|`, parentheses), and four or five examples. Designed to fit 40 columns via `^A\` continuations like `textsrch.msg`.
- New `sbbs_t::get_ars_string(char* str, size_t maxlen, int kmode)` next to `get_search_string()`: prompt with `UeditARSearchPrompt`, intercept `?` and show the menu, compile with `arstr()`, return the compiled AR for the caller to free. The user editor's `/` case becomes one call.
- `BULKMAIL` in `str_cmds.js` either calls a new `bbs.get_ars_string()` method or just checks for `?` itself and calls `bbs.menu("ars")` before `bbs.bulk_mail()`. The latter is a three-line change and needs no new JS method, but switching the prompt to `bbs.text(UeditARSearchPrompt)` would also make it translatable.
- Add a `[?=help]` hint to the prompt wording (as the search prompt has), or the feature is undiscoverable.
## Caveat
Only half of the `textsrch.msg` pattern carries over. `get_search_string()` shows the help in two cases: `?` typed alone, and a compile error from `bool_expr_compile()`. `arstr()` has no error reporting at all - an unknown keyword falls through to `AR_LEVEL` (`ars.c`, "if (artype == AR_INVALID) artype = AR_LEVEL") or is silently skipped, so a typo like `LEVL 50` compiles to a level check and nobody is told.
So the help screen would only be reachable when the sysop knows to ask for it. The more valuable path, "you typed something wrong, here is the syntax", needs `arstr()` to gain a diagnostic return first. That is a bigger change (it would benefit SCFG's `getar()` too) and is a separate decision from the menu file, but it is what would make the help genuinely useful.
- *Authored by Claude (Claude Code), on behalf of @rswindell*
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)