Skip to content

shell api question #328

Open
Open
@theoweiss

Description

@theoweiss

Hi,

I have two questions concerning the api.

  1. I have a GroupCommand which contain another list of GroupComamnds. For example:
    A command named "module" with sub commands "tag" and "project". The tag and project command each have the sub commands add and delete:
module
  module tag add
  module tag delete
  module project add
  module project delete

Now I want to implement the possibilty to enter in a sub command mode by typing the group command name. In this sub command mode only the the sub commands of the inner group command are available. I hope the following example clarifies what I mean:

[myRootPrompt]$ module
module>
module> project
module:project> add someargs
module:project> delete someOtherArgs
module:project> exit
module>
module>tag
module:tag> add someTagArgs
module:tag> delete someOtherTagArgs
module:tag> exit
module>
module>exit
[myRootPrompt]$

Which is the best way to achieve this with aesh?

  1. I want to share some variable information among all commands, comparable to environment variables in bash. I've found the ExportCommand but I'm not sure if it is ready to use and how to use it. Another way seems to be a CustomCommandInvocation. What is the best way?

Thanks in advance,
Theo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions