The goal is for forky to have shell syntax with all the features of your favorite terminal. However, the nature of IRC prevents some challenges, for example:
IF YOU HAVE SUGGESTIONS FOR SYNTAX, PLEASE ADD IT DOWN THERE IN THE NEEDED SECTION
"!command »> user" produces "user: output"
"»>" is a derivative of shell file redirectors ">" and "»". "»>" acts as a redirector in forkb0t's code. DO NOT THINK OF IT AS A PREFIXER. When forkb0t runs a commandline, he "redirects" the output to a user in the channel. Without "»>", he will "redirect" to whoever ran the command (there are some exceptions, such as multiline spam.
"!command »» channel" pipes output to channel
"»»" was chosen because this is a "greater form of redirection" than "»>". When forkb0t runs a command line, he must indicate in the raw PRIVMSG IRC string as to where the output is going. Without "»»", he will use the channel in which the user ran the command.
"!command1 <!command2" executes command2 and passes output as arguments to command1
Initially this was supposed to be a copy of the pipe (|) from sh. However, forkb0t's commands have no concept of "stdin". They only have arguments. Hence the pipe effort was reduced to "piping as arguments". Note that "<!" is a bit of a misnomer. Since all of forkb0t's commands currently begin with !. Now we have this funky syntax that is hard to understand unless you know how the code works. Here are some comparisons to help.
forkb0t: !cowsay <!forksay panda shell: cowsay $(forksay panda) forkb0t: !cowsay <!gtrans en2de <!wiki buttsecks shell: cowsay $(gtrans en2de $(wiki buttsecks))
As you can see, essentially <! is a nesting operator. If "stdin" and "arguments" were the same in your sh, then the shell pipe (|) would do the same thing but in reverse (if this makes sense).
Well, "<!" really takes care of this already, except that the order is reversed, which makes it a bit confusing.
perhaps !()
!forksay is the forkb0t equivalent of cat, and if command substitution is implemented then technically there is no need for a special operator for string joining. Although it may be simpler to implement something like "!+" than command substitution.
<krushia>!dict panda !+ | <!wiki panda <forkb0t> krushia: panda - 1. large black-and-white Chinese mammal | "The Giant Panda (Ailuropoda melanoleuca, literally meaning 'cat-foot black-and-white') is a bear native to central-western and southwestern China." - http://en.wikipedia.org/wiki/Panda
idk, kinda nasty
Currently if you don't want the name prefixed, you can do "!forksay <!command" because !forksay doesn't prefix by default. Of course users don't figure this trick out easily, so a specific operator may be of benefit.
Currently there is no way to pass characters, such as CR, to forkb0t.