remove q quit alias
`q` was introduced in round-5 as a peer Keyword variant alongside `quit`. Per ADR-0023's "alias miss" critique, that was the wrong shape — it surfaced `q` as a standalone command in completion (only one of its kind), and required parallel parser + usage + catalog + test entries. Drops the Keyword variant entirely; if this ever needs to come back, it should arrive as an alias annotation per ADR-0023, not as a peer keyword. Tests still 769 passing.
This commit is contained in:
+1
-1
@@ -640,7 +640,7 @@ mod tests {
|
|||||||
// App-lifecycle commands now appear alongside DSL
|
// App-lifecycle commands now appear alongside DSL
|
||||||
// commands in the entry-keyword set.
|
// commands in the entry-keyword set.
|
||||||
for expected in &[
|
for expected in &[
|
||||||
"quit", "q", "help", "rebuild", "save", "new", "load", "export",
|
"quit", "help", "rebuild", "save", "new", "load", "export",
|
||||||
"import", "mode", "messages",
|
"import", "mode", "messages",
|
||||||
] {
|
] {
|
||||||
assert!(
|
assert!(
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ define_keywords! {
|
|||||||
// routing so these work in both simple and advanced modes
|
// routing so these work in both simple and advanced modes
|
||||||
// (per ADR-0003).
|
// (per ADR-0003).
|
||||||
Quit => "quit",
|
Quit => "quit",
|
||||||
Q => "q",
|
|
||||||
Help => "help",
|
Help => "help",
|
||||||
Rebuild => "rebuild",
|
Rebuild => "rebuild",
|
||||||
Save => "save",
|
Save => "save",
|
||||||
|
|||||||
+1
-2
@@ -469,8 +469,7 @@ fn command_parser<'a>()
|
|||||||
// BEFORE chumsky runs; the bare-keyword forms below
|
// BEFORE chumsky runs; the bare-keyword forms below
|
||||||
// surface the `Path: None` / no-source variants for
|
// surface the `Path: None` / no-source variants for
|
||||||
// empty-prompt completion + usage rendering.
|
// empty-prompt completion + usage rendering.
|
||||||
let quit_cmd = choice((kw(Keyword::Quit), kw(Keyword::Q)))
|
let quit_cmd = kw(Keyword::Quit).map(|()| Command::App(AppCommand::Quit));
|
||||||
.map(|()| Command::App(AppCommand::Quit));
|
|
||||||
let help_cmd = kw(Keyword::Help).map(|()| Command::App(AppCommand::Help));
|
let help_cmd = kw(Keyword::Help).map(|()| Command::App(AppCommand::Help));
|
||||||
let rebuild_cmd =
|
let rebuild_cmd =
|
||||||
kw(Keyword::Rebuild).map(|()| Command::App(AppCommand::Rebuild));
|
kw(Keyword::Rebuild).map(|()| Command::App(AppCommand::Rebuild));
|
||||||
|
|||||||
+4
-10
@@ -99,10 +99,6 @@ pub const REGISTRY: &[UsageEntry] = &[
|
|||||||
entry: Keyword::Quit,
|
entry: Keyword::Quit,
|
||||||
catalog_key: "parse.usage.quit",
|
catalog_key: "parse.usage.quit",
|
||||||
},
|
},
|
||||||
UsageEntry {
|
|
||||||
entry: Keyword::Q,
|
|
||||||
catalog_key: "parse.usage.quit",
|
|
||||||
},
|
|
||||||
UsageEntry {
|
UsageEntry {
|
||||||
entry: Keyword::Help,
|
entry: Keyword::Help,
|
||||||
catalog_key: "parse.usage.help",
|
catalog_key: "parse.usage.help",
|
||||||
@@ -220,7 +216,6 @@ mod tests {
|
|||||||
Keyword::Delete,
|
Keyword::Delete,
|
||||||
Keyword::Replay,
|
Keyword::Replay,
|
||||||
Keyword::Quit,
|
Keyword::Quit,
|
||||||
Keyword::Q,
|
|
||||||
Keyword::Help,
|
Keyword::Help,
|
||||||
Keyword::Rebuild,
|
Keyword::Rebuild,
|
||||||
Keyword::Save,
|
Keyword::Save,
|
||||||
@@ -308,16 +303,15 @@ mod tests {
|
|||||||
fn entry_keywords_alphabetised_returns_unique_sorted_commands() {
|
fn entry_keywords_alphabetised_returns_unique_sorted_commands() {
|
||||||
let keys = entry_keywords_alphabetised();
|
let keys = entry_keywords_alphabetised();
|
||||||
let names: Vec<&str> = keys.iter().map(|k| k.as_str()).collect();
|
let names: Vec<&str> = keys.iter().map(|k| k.as_str()).collect();
|
||||||
// Ten DSL entries plus the eleven app-lifecycle entries
|
// Ten DSL entries plus the ten app-lifecycle entries
|
||||||
// registered in REGISTRY (quit/q are two keywords with
|
// registered in REGISTRY.
|
||||||
// the same usage template; both surface here).
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
names,
|
names,
|
||||||
vec![
|
vec![
|
||||||
"add", "change", "create", "delete", "drop", "export",
|
"add", "change", "create", "delete", "drop", "export",
|
||||||
"help", "import", "insert", "load", "messages", "mode",
|
"help", "import", "insert", "load", "messages", "mode",
|
||||||
"new", "q", "quit", "rebuild", "rename", "replay",
|
"new", "quit", "rebuild", "rename", "replay", "save",
|
||||||
"save", "show", "update",
|
"show", "update",
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ pub const KEYS_AND_PLACEHOLDERS: &[(&str, &[&str])] = &[
|
|||||||
("parse.token.keyword.null", &[]),
|
("parse.token.keyword.null", &[]),
|
||||||
("parse.token.keyword.on", &[]),
|
("parse.token.keyword.on", &[]),
|
||||||
("parse.token.keyword.pk", &[]),
|
("parse.token.keyword.pk", &[]),
|
||||||
("parse.token.keyword.q", &[]),
|
|
||||||
("parse.token.keyword.quit", &[]),
|
("parse.token.keyword.quit", &[]),
|
||||||
("parse.token.keyword.rebuild", &[]),
|
("parse.token.keyword.rebuild", &[]),
|
||||||
("parse.token.keyword.relationship", &[]),
|
("parse.token.keyword.relationship", &[]),
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ help:
|
|||||||
<project-path>.
|
<project-path>.
|
||||||
|
|
||||||
App-level commands (typed inside the app, available in both modes):
|
App-level commands (typed inside the app, available in both modes):
|
||||||
quit / q Exit cleanly.
|
quit Exit cleanly.
|
||||||
mode simple|advanced Switch input mode.
|
mode simple|advanced Switch input mode.
|
||||||
help Show this list of commands in-app.
|
help Show this list of commands in-app.
|
||||||
save Save the current temp project under a
|
save Save the current temp project under a
|
||||||
@@ -214,7 +214,7 @@ help:
|
|||||||
# math stays accurate.
|
# math stays accurate.
|
||||||
in_app_body: |
|
in_app_body: |
|
||||||
Supported commands:
|
Supported commands:
|
||||||
quit / q — exit
|
quit — exit
|
||||||
help — this list
|
help — this list
|
||||||
mode simple|advanced — switch input mode
|
mode simple|advanced — switch input mode
|
||||||
messages — show current verbosity
|
messages — show current verbosity
|
||||||
@@ -355,7 +355,7 @@ parse:
|
|||||||
# grammar that the parser accepts; the in-app `help`
|
# grammar that the parser accepts; the in-app `help`
|
||||||
# listing in `help.in_app_body` carries the user-facing
|
# listing in `help.in_app_body` carries the user-facing
|
||||||
# description.
|
# description.
|
||||||
quit: "quit | q"
|
quit: "quit"
|
||||||
help: "help"
|
help: "help"
|
||||||
rebuild: "rebuild"
|
rebuild: "rebuild"
|
||||||
save: "save | save as"
|
save: "save | save as"
|
||||||
@@ -406,7 +406,6 @@ parse:
|
|||||||
# App-lifecycle commands (per ADR-0003, surfaced through
|
# App-lifecycle commands (per ADR-0003, surfaced through
|
||||||
# the parser to drive completion + usage templates).
|
# the parser to drive completion + usage templates).
|
||||||
quit: "`quit`"
|
quit: "`quit`"
|
||||||
q: "`q`"
|
|
||||||
help: "`help`"
|
help: "`help`"
|
||||||
rebuild: "`rebuild`"
|
rebuild: "`rebuild`"
|
||||||
save: "`save`"
|
save: "`save`"
|
||||||
|
|||||||
Reference in New Issue
Block a user