mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
analyzer/finger: Reformat with spicy-format
This commit is contained in:
parent
cde5662779
commit
dae4b1fcd9
1 changed files with 10 additions and 8 deletions
|
@ -8,13 +8,15 @@ module Finger;
|
||||||
import spicy;
|
import spicy;
|
||||||
|
|
||||||
const OptionalWhiteSpace = /[ \t]*/;
|
const OptionalWhiteSpace = /[ \t]*/;
|
||||||
const NewLine = /\r?\n/;
|
const NewLine = /\r?\n/;
|
||||||
|
|
||||||
public type Request = unit {
|
public type Request = unit {
|
||||||
: OptionalWhiteSpace;
|
: OptionalWhiteSpace;
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
-> : /\/W/ { self.whois = True; }
|
-> : /\/W/ {
|
||||||
|
self.whois = True;
|
||||||
|
}
|
||||||
-> : void;
|
-> : void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,12 +26,12 @@ public type Request = unit {
|
||||||
# We require valid UTF-8 to weed out binary data.
|
# We require valid UTF-8 to weed out binary data.
|
||||||
self.user = self.arg[0].decode();
|
self.user = self.arg[0].decode();
|
||||||
|
|
||||||
if ( |self.arg[1]| > 0 )
|
if (|self.arg[1]| > 0)
|
||||||
self.host = self.arg[1].decode();
|
self.host = self.arg[1].decode();
|
||||||
}
|
}
|
||||||
|
|
||||||
on %done {
|
on %done {
|
||||||
if ( |self.arg[0]| > 0 || self.whois )
|
if (|self.arg[0]| > 0 || self.whois)
|
||||||
spicy::accept_input();
|
spicy::accept_input();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,12 +45,12 @@ type ReplyLine = unit {
|
||||||
: NewLine;
|
: NewLine;
|
||||||
|
|
||||||
on %done {
|
on %done {
|
||||||
if ( |self.data| > 10 )
|
if (|self.data| > 10)
|
||||||
# Require some non-trivial output to accept.
|
# Require some non-trivial output to accept.
|
||||||
spicy::accept_input();
|
spicy::accept_input();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public type Reply = unit {
|
public type Reply = unit {
|
||||||
: ReplyLine[];
|
: ReplyLine[];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue