feat(commands): step the rest of the keyword/value commands

Convert the remaining bucket-B commands to prompt step by step instead of
requiring arguments or printing usage:

- KeywordCommand (buttons): VIEW, LINETYPE, SCALELISTEDIT, UCSICON, VSCURRENT.
- ValuePromptCommand (one value): LAYDEL (layer), ATTSYNC (block).
- TwoValuePromptCommand (new; two values): LAYMRG (source + target),
  SETVAR (variable + value, blank second reads).

Each bare form now starts the stepped front-end and delegates to the existing
inline handler; the argument form is kept and is the dispatch target. The
direct visual-style shortcuts (HIDDENLINE / XRAY / …) and UCSICON's argument
form are untouched.

COUNT is intentionally left alone: bare COUNT already reports the tally (a
useful inquiry action, not a usage line), so prompting would only add friction.
This commit is contained in:
Hakan Seven 2026-07-16 13:29:04 +03:00
commit 4c3509fa51
7 changed files with 186 additions and 16 deletions

View file

@ -400,7 +400,22 @@ impl OpenCADStudio {
)));
}
cmd if cmd == "VIEW" || cmd.starts_with("VIEW ") => {
"VIEW" => {
use crate::command::KeywordCommand;
let c = KeywordCommand::new(
"VIEW",
"VIEW [List / Save / Restore / Delete]:",
vec![
("List", "LIST", None),
("Save", "SAVE", Some("VIEW SAVE new view name:")),
("Restore", "RESTORE", Some("VIEW RESTORE view name:")),
("Delete", "DELETE", Some("VIEW DELETE view name:")),
],
);
self.command_line.push_info(&c.prompt());
self.tabs[i].active_cmd = Some(Box::new(c));
}
cmd if cmd.starts_with("VIEW ") => {
let parts: Vec<&str> = cmd.splitn(3, ' ').collect();
let sub = parts.get(1).map(|s| s.to_uppercase()).unwrap_or_default();
match sub.as_str() {