Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/Foundation/Console/Commands/EventCommand.imba
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Command } from '../Command'
import { Prop } from '@formidablejs/console'

export class EventCommand < Command

get signature
event + ' {--dev} {--port=} {--host=} {--noAnsi}'

get props
{
dev: Prop.boolean().default(false)
port: Prop.number().default(3000)
host: Prop.string().default('localhost')
noAnsi: Prop.boolean().default(false)
}

def handle
const dev = self.option('dev')
const port = self.option('port')
const host = self.option('host')
const noAnsi = self.option('noAnsi')

if persist then return persist(dev, port, host, noAnsi)

self.error('No event handler found')
13 changes: 13 additions & 0 deletions types/Foundation/Console/Commands/EventCommand.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Command } from "../Command";

export class EventCommand extends Command {
/**
* The console command signature name.
*/
get event(): string;

/**
* Execute event command.
*/
persist(dev: boolean, port: number, host: string, noAnsi: boolean): Promise<void>;
}