ln-e/console
Console component
Installs: 0
Dependents: 0
Suggesters: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:OpenEdge ABL
Requires (Dev)
- parser/autoload: ^1.0
README
A component that facilitates the creation of console commands in Parser3.
Installation
The preferred method of installation is throw parsekit
parsekit require ln-e/console
Do not forget to use vault/classpath.p in auto.p
^use[./vault/classpath.p]
Usage
Create application and configure commands
$app[^Application::create[]]
^app.register[^SomeCommand::create[]]
^app.register[^SomeOtherCommand::create[]]
$result[$result^app.run[]]
Or you can extend Application class and implement loading commands as you need. I.e. load all *Command.p files in some directory:
@CLASS
Application
@OPTIONS
locals
@auto[]
$Application:options[^hash::create[]]
###
#------------------------------------------------------------------------------
#Configures list of available commands
#------------------------------------------------------------------------------
@configureCommands[][result]
# implement getting available commands such as
$files[^file:list[./Commands/;\sCommand.p]]
^files.menu{
^self.register[^reflection::create[^list.replace[.p;];create]]
}
###