Re: command aliases and tool/command wiki page

Posted by dxli on
URL: https://forum.librecad.org/command-aliases-and-tool-command-wiki-page-tp5711297p5711371.html

actually, I think a major cleanup is needed.

1, coding part. I'm thinking about including a data table to separate code and aliases;

2, command part, we should print out short comand and alias in command widget at action launch (enable/disable by options); or in Menu. button tool tips;

3, logic and intuitive commands;




ravas wrote
I'm updating http://wiki.librecad.org/index.php/Commands_and_tools_-_using_the_command_line
But I'm confused by the inconsistency of rs_commands.cpp.
I could help out with cleaning it up if I could see a logical pattern.

Compare DrawLineRectangle and ZoomRedraw:

    cmdTranslation.insert("rectangle", tr("rectangle"));
    mainCommands.insert(tr("rectangle"), RS2::ActionDrawLineRectangle);
    cmdTranslation.insert("rect", tr("rect"));
    shortCommands.insert(tr("rectang"), RS2::ActionDrawLineRectangle);
    shortCommands.insert(tr("rect"), RS2::ActionDrawLineRectangle);
    shortCommands.insert(tr("rec"), RS2::ActionDrawLineRectangle);

    // zoom:
    cmdTranslation.insert("regen", tr("regen"));
    cmdTranslation.insert("redraw", tr("redraw"));
    mainCommands.insert(tr("regen"), RS2::ActionZoomRedraw);
    mainCommands.insert(tr("redraw"), RS2::ActionZoomRedraw);
    shortCommands.insert(tr("rg", "zoom - redraw"), RS2::ActionZoomRedraw);

    cmdTranslation.insert("zr", tr("zr"));
    shortCommands.insert(tr("zr", "zoom - redraw"), RS2::ActionZoomRedraw);

Why cmdTranslation for only rect and rectangle (and not for rec)?

Why mainCommands for regen and redraw?
Doesn't it make sense to have only one main command (thinking of the alias file)?

Why two aliases in shortCommands.insert(tr("rg", "zoom - redraw")?