Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ln-e/console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Console component

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]]
    }
###

About

Parser3 console component

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published