diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 1f3d4b8852..cc3902bd0f 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -252,8 +252,10 @@ pub enum ServerChatCommand { BuildAreaList, BuildAreaRemove, Campfire, + CreateLocation, DebugColumn, DebugWays, + DeleteLocation, DisconnectAllPlayers, DropAll, Dummy, @@ -277,9 +279,12 @@ pub enum ServerChatCommand { Kit, Lantern, Light, + Lightning, + Location, MakeBlock, MakeNpc, MakeSprite, + MakeVolume, Motd, Object, PermitBuild, @@ -305,15 +310,10 @@ pub enum ServerChatCommand { Unban, Version, Waypoint, + WeatherZone, Whitelist, Wiring, World, - MakeVolume, - Location, - CreateLocation, - DeleteLocation, - WeatherZone, - Lightning, } impl ServerChatCommand { diff --git a/voxygen/src/cmd.rs b/voxygen/src/cmd.rs index fd286d12a5..aa198afa82 100644 --- a/voxygen/src/cmd.rs +++ b/voxygen/src/cmd.rs @@ -121,6 +121,24 @@ impl FromStr for ChatCommandKind { } else if let Ok(cmd) = s.parse::() { Ok(ChatCommandKind::Server(cmd)) } else { + // Idea: + // The ServerChatCommand enum in veloren/common/src/cmd.rs is a list of valid + // commands. We should output something like: + + // Could not find a command named "group_kcik" + // Did you mean: + // group_kick + + // Could not find a command named "make" + // Did you mean: + // make_block + // make_npc + // make_sprite + + // We should be suggesting command(s) similar to the ones typed + // - a regex to match possible typos? + // - Naively suggest the other commands that start with the same first letter? + // (Might be ok, there most commands for a letter is "S" with 10 commands) Err(format!("Could not find a command named {}.", s)) } }