Giter Site home page Giter Site logo

Comments (10)

stillwwater avatar stillwwater commented on July 19, 2024

What about prefixing the help string with a group name? Something like:

[RegisterCommand("cube.move", Help = "cube/Move test cube")]
static void CommandMove(CommandArg[] args) { }

[RegisterCommand("cube.rotate", Help = "cube/Rotate test cube")]
static void CommandRotate(CommandArg[] args) { }

Then calling the help command would only show "cube", and calling help cube would list all commands in the group.

That way this is only a documentation thing, and doesn't affect how commands are processed internally. Allowing it to be an optional feature.

Either way I think you make a valid point, my projects use enough commands that the help command isn't super useful, and I find my self using help command_name most of the time. Having groups would likely make the command documentation more organized and easier to navigate.

from command_terminal.

Wokarol avatar Wokarol commented on July 19, 2024

That would work, especially with new autocomplete

from command_terminal.

stillwwater avatar stillwwater commented on July 19, 2024

I've added this functionality to the help command. Example using ed as a group:

screenshot

from command_terminal.

Wokarol avatar Wokarol commented on July 19, 2024

How about adding option not to create a help menu for command?
For example I have 3 objects and every object creates command with name "{name}.jump" and I don't want to show any of this groups in help menu?

from command_terminal.

stillwwater avatar stillwwater commented on July 19, 2024

So just a way to not show the command at all?

Also, why create a jump command for each object instead of having a single jump command that receives an identifier like jump {name}?

from command_terminal.

Wokarol avatar Wokarol commented on July 19, 2024

Because I don't need to create one object to hold all objects with jump command, instead every object can add it's own command, and autocomplete supports it.
When I think of it I can create static class to store objects which is good but there is still no autocomplete support.

from command_terminal.

stillwwater avatar stillwwater commented on July 19, 2024

Ah that makes sense, the groups would allow you to group all {name} objects together or all jump commands together. Why would you want to hide everything?

Something like:

[RegisterCommand("cube1.jump", Help = "jump/Cube1 jump")]
static void CommandJump1(CommandArg[] args) { }

[RegisterCommand("cube2.jump", Help = "jump/Cube2 jump")]
static void CommandJump2(CommandArg[] args) { }

would only show jump (not the individual cube.jump commands) in the help list, to see both commands you would use help jump.

By the way, you can add things to the autocomplete with Terminal.Autocomplete.Register("name"). But I get what you're saying, you want separate commands.

from command_terminal.

Wokarol avatar Wokarol commented on July 19, 2024

Making command structure like {object}.{group}.{command} is just more logical to me.
equipment.gear.add helmet is more logical to me than add equipment gear helmet or equipment_add gear helmet

from command_terminal.

Wokarol avatar Wokarol commented on July 19, 2024

But after some thought jump {name} might be more logical

from command_terminal.

AmAutoma avatar AmAutoma commented on July 19, 2024

I've added this functionality to the help command. Example using ed as a group:

screenshot

Excuse me, is this already available?

from command_terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.