glirc-2.36: Console IRC client

Copyright(c) Eric Mertens 2016-2020
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.Commands.Types

Description

 
Synopsis

Documentation

data CommandResult Source #

Possible results of running a command

Constructors

CommandSuccess ClientState

Continue running the client, consume input if command was from input

CommandFailure ClientState

Continue running the client, report an error

CommandQuit ClientState

Client should close

type ClientCommand a Source #

Arguments

 = ClientState 
-> a

arguments

-> IO CommandResult 

Type of commands that always work

type NetworkCommand a Source #

Arguments

 = NetworkState

current network

-> ClientCommand a 

Type of commands that require an active network to be focused

type ChannelCommand a Source #

Arguments

 = Identifier

focused channel

-> NetworkCommand a 

Type of commands that require an active channel to be focused

data CommandImpl a Source #

Pair of implementations for executing a command and tab completing one. The tab-completion logic is extended with a Bool indicating that tab completion should be reversed

Constructors

ClientCommand (ClientCommand a) (Bool -> ClientCommand String)

no requirements

NetworkCommand (NetworkCommand a) (Bool -> NetworkCommand String)

requires an active network

ChatCommand (ChannelCommand a) (Bool -> ChannelCommand String)

requires an active chat window

ChannelCommand (ChannelCommand a) (Bool -> ChannelCommand String)

requires an active channel window

data Command Source #

A command is a list of aliases, an argument specification, implementation, and documentation. The arguments and implementation must match so that the parsed arguments will match what the implementation expects.

Constructors

Command 

Fields

data CommandSection Source #

A command section is a logical grouping of commands. This allows for showing more structure in the help menu system.

commandSuccess :: Monad m => ClientState -> m CommandResult Source #

Consider the text entry successful and resume the client

commandFailure :: Monad m => ClientState -> m CommandResult Source #

Consider the text entry a failure and resume the client

commandFailureMsg :: Text -> ClientState -> IO CommandResult Source #

Command failure with an error message printed to client window