127 lines
3.1 KiB
Markdown
127 lines
3.1 KiB
Markdown
|
|
||
|
# Command Processor Form (Cmdproc-6.frm)
|
||
|
|
||
|
## Overview
|
||
|
The Command Processor form provides a user interface for executing and managing commands in the application. It handles command parsing, validation, execution and result display.
|
||
|
|
||
|
## Key Components
|
||
|
|
||
|
### Command Input
|
||
|
- Text input field for entering commands
|
||
|
- Command history tracking
|
||
|
- Auto-complete suggestions
|
||
|
- Syntax highlighting
|
||
|
|
||
|
### Command Processing
|
||
|
- Parses raw command text into structured format
|
||
|
- Validates command syntax and parameters
|
||
|
- Routes commands to appropriate handlers
|
||
|
- Manages command execution state
|
||
|
|
||
|
### Results Display
|
||
|
- Shows command output in scrollable window
|
||
|
- Formats results based on command type
|
||
|
- Error handling and status messages
|
||
|
- Copy/export capabilities
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
### Basic Command Format
|
||
|
|
||
|
[Command] [Parameters] [Options]
|
||
|
|
||
|
|
||
|
### Common Commands
|
||
|
- HELP - Display command help
|
||
|
- CLEAR - Clear output window
|
||
|
- EXIT - Close command processor
|
||
|
- HISTORY - Show command history
|
||
|
|
||
|
### Parameters
|
||
|
- Required parameters shown in <angle brackets>
|
||
|
- Optional parameters shown in [square brackets]
|
||
|
- Multiple parameters separated by spaces
|
||
|
|
||
|
### Options
|
||
|
- Start with forward slash (/)
|
||
|
- Format: /OptionName[:Value]
|
||
|
- Multiple options allowed per command
|
||
|
|
||
|
## Error Handling
|
||
|
- Invalid commands return error message
|
||
|
- Parameter validation with specific error details
|
||
|
- Option validation and defaults
|
||
|
- Exception handling with user-friendly messages
|
||
|
|
||
|
## Events
|
||
|
- OnCommand - Fires when command entered
|
||
|
- OnComplete - Fires when command finishes
|
||
|
- OnError - Fires on command error
|
||
|
- OnStateChange - Fires when processor state changes
|
||
|
|
||
|
## Properties
|
||
|
- CommandHistory - Collection of previous commands
|
||
|
- IsProcessing - Current execution state
|
||
|
- LastResult - Most recent command result
|
||
|
- ErrorLevel - Last command error status
|
||
|
|
||
|
## Methods
|
||
|
- ExecuteCommand(string command)
|
||
|
- ParseCommand(string rawCommand)
|
||
|
- ValidateCommand(Command cmd)
|
||
|
- ShowResults(CommandResult results)
|
||
|
- ClearDisplay()
|
||
|
|
||
|
## Dependencies
|
||
|
- Command parser library
|
||
|
- Results formatter
|
||
|
- History manager
|
||
|
- Auto-complete provider
|
||
|
|
||
|
## Configuration
|
||
|
- MaxHistoryItems - Maximum history entries
|
||
|
- AutoCompleteEnabled - Enable/disable suggestions
|
||
|
- DefaultTimeout - Command timeout in seconds
|
||
|
- OutputFormat - Default output formatting
|
||
|
|
||
|
## Version Differences
|
||
|
|
||
|
### Cmdproc-1
|
||
|
- Basic command processing functionality
|
||
|
- Simple parameter parsing
|
||
|
- Limited error handling
|
||
|
- No event system
|
||
|
|
||
|
### Cmdproc-2
|
||
|
- Added command history
|
||
|
- Basic parameter validation
|
||
|
- Improved error messages
|
||
|
- Simple event handling
|
||
|
|
||
|
### Cmdproc-3
|
||
|
- Introduced option support
|
||
|
- Enhanced parameter validation
|
||
|
- Added command timeout
|
||
|
- Basic auto-complete
|
||
|
|
||
|
### Cmdproc-4
|
||
|
- Full event system implementation
|
||
|
- Advanced error handling
|
||
|
- Extended configuration options
|
||
|
- History management
|
||
|
|
||
|
### Cmdproc-5
|
||
|
- Dependency injection support
|
||
|
- Modular command processing
|
||
|
- Enhanced auto-complete
|
||
|
- Result formatting options
|
||
|
|
||
|
### Cmdproc-6 (Current)
|
||
|
- Complete event system
|
||
|
- Comprehensive error handling
|
||
|
- Full configuration support
|
||
|
- Advanced command processing
|
||
|
- Integrated dependency management
|
||
|
- Enhanced history features
|
||
|
- Robust parameter/option handling
|