-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
enhancementNew feature or requestNew feature or requesthacktoberfestThis is for HacktoberfestThis is for Hacktoberfesthacktoberfest-acceptedThis is for HacktoberfestThis is for Hacktoberfest
Description
Feature: Command Aliases & Custom Commands
Description
Add support for user-defined command aliases to simplify repetitive tasks and create shortcuts for complex command sequences.
Motivation
Users often execute the same commands repeatedly or need to chain multiple commands together. Command aliases would:
- Reduce typing for frequently used commands
- Allow custom shortcuts (e.g.,
llfordir /w) - Support command chaining (e.g.,
update=cd projects && dir) - Improve productivity and user experience
Proposed Implementation
Core Features
-
Create Alias:
alias name="command"- Example:
alias ll="dir /w" - Example:
alias docs="cd C:\Users\Documents"
- Example:
-
List Aliases:
alias(with no arguments)- Display all registered aliases
-
Remove Alias:
unalias name- Example:
unalias ll
- Example:
-
Persistent Storage: Save aliases to
.mycmd_aliasesfile- Load aliases on shell startup
- Auto-save when aliases are modified
Technical Requirements
- Create
AliasCommand.javafor managing aliases - Create
UnaliasCommand.javafor removing aliases - Create
AliasManager.javautility class for alias operations - Add alias resolution in main command execution loop
- Implement file I/O for persistent storage
- Add alias support to
ShellContext.java - Update
HelpCommand.javato include alias documentation
Acceptance Criteria
- Users can create aliases with
aliascommand - Aliases persist across shell sessions
- Aliases can be listed with
aliascommand - Aliases can be removed with
unaliascommand - Circular alias references are prevented
- Error handling for invalid alias names
- Help documentation is updated
Example Usage
MyCMD>alias ll="dir /w"
Alias created: ll="dir /w"
MyCMD>ll
[executes dir /w command]
MyCMD>alias
ll="dir /w"
docs="cd C:\Users\Documents"
MyCMD>unalias ll
Alias removed: llReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthacktoberfestThis is for HacktoberfestThis is for Hacktoberfesthacktoberfest-acceptedThis is for HacktoberfestThis is for Hacktoberfest