Skip to content

[Bug] Add weather.set <name> console command (naming consistency with weather.* family) #9

Description

@lextpf

Problem statement

The weather command family is weather.intensity, weather.next, weather.random - but the direct
setter for weather state is registered as time.weather (ConsoleCommands.cpp:3565). This breaks the
user's mental model: weather setters live under weather.* everywhere except the most important
one. Users hunting for "how do I set the weather" reasonably type weather.set Clear and get
"unknown command". The mismatch is also visible in tab completion: typing weather. does not
surface the setter.

Suggested implementation

Add a parallel registration block right after the weather.random registration at ~line 3607:

m_Registry.Register(
"weather.set",
"<name> - set weather state (alias of time.weather)",
[makeContext](auto args, Console&)
{
  CommandContext ctx = makeContext();
  (void)Cmd_TimeWeather(args, ctx);  // intentional: shared handler
},
{"weather"},
[](std::size_t argIndex) -> std::vector<std::string>
{
  // Copy the tab-completion body from time.weather's registration,
  // OR factor both into a single named lambda above the registration block.
});

Proposed solution

Add weather.set as a thin alias to Cmd_TimeWeather. Both commands continue to work (no
breaking change). Tab completion for the new alias should provide the same state-name suggestions
that time.weather already provides. The existing tab-completion lambda at
ConsoleCommands.cpp:3574-3583 can be reused.

Alternatives considered

Not applicable - this approach is simple

Scope

Not applicable - the scope is clear

Pre-submission checklist

  • I searched existing issues and this proposal is not a duplicate.
  • This is a user-facing capability or improvement and not a purely internal task.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions