The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download | Blog
Personal tools
InspIRCd - 10,000 revisions reached!

Syntax

From the makers of InspIRCd.

Jump to: navigation, search

In this wiki, there are many locations where we document the syntax for commands etc. The format follows a well known simplified form of BNF (Backus Naur Form) which can be used to represent many types of complex syntax.

In the syntax examples we use, nouns enclosed by the constructs below should not be taken literally when issuing a command. For example, if the command syntax states <nick>, do not type the literal string "<nick>" or "nick", place a nickname there.

The basic constructs we use are shown below:

<mandatory>

Text enclosed in angle brackets (<>) is a mandatory parameter. Only one parameter should be enclosed in each set of angle brackets. For example:

PRIVMSG <channel> :<text>

Indicates that the parameters <channel> and <text> are mandatory.

[optional]

Text enclosed in square brackets ([]) is optional. Further parameters may be enclosed inside the square brackets. For example:

INVITE [ <nick> <channel> ]

This indicates that there are two parameters to INVITE, and they are optional. However, because both "nick" and "channel" are within the same set of angle brackets, it indicates that both must be specified, or none at all. However, in the following example;

SAPART <nick> [channel]

In the command above, only one of the parameters is optional, therefore both "/SAPART nicknamehere" and "/SAPART nicknamehere reasonhere" are fine.

{repeating ...}

Text enclosed in curly braces ({}) and optionally followed by an ellipsis (...) may be repeated one or more times. For example:

WOBBLE <nick> { [, <nick> ] }

The somewhat complex example above states the following:

  • There must be an initial nickname, indicated by the <nick> parameter on its own at the start of the syntax
  • There may be one or more other nicks following the first nick, and that this is optional
  • That in the case of including extra nicks, a literal comma "," must be used to separate them