Skip to content

[FEATURE] set Command #75

@Kaveeshakavindi

Description

@Kaveeshakavindi

Is your feature request related to a problem? Please describe.
Currently, MyCMD does not have a way to store or view environment-style variables (like temporary shell variables). This limits flexibility when writing commands or scripts that need to reuse values, such as directory paths or usernames.

Describe the solution you'd like

  • Implement a set command that allows users to:
  • View all existing shell variables (set)
  • Create or update a variable (set NAME=VALUE)
  • Display a specific variable’s value (set NAME)
  • The variables should be stored in ShellContext so they persist within the current session.

Describe alternatives you've considered
An alternative would be to directly manipulate environment variables at the system level, but that could cause permission or persistence issues. Storing variables in the shell context keeps the implementation lightweight and safe for user-level operations.

Additional context

  • This feature introduces support for internal variable management.
  • It improves shell usability and prepares for more complex commands (like if, for, or path).
  • Includes SetCommand.java implementation, updates to ShellContext for variable storage, and registration in App.java.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions