mirror of
https://github.com/fiatjaf/nak.git
synced 2024-10-30 09:09:08 -04:00
event: fix handling of -k and kind in stdin event, and default to 1.
This commit is contained in:
parent
4a3c7dc825
commit
53cb2c0490
6
event.go
6
event.go
|
@ -148,11 +148,13 @@ example:
|
||||||
}
|
}
|
||||||
kindWasSupplied = strings.Contains(stdinEvent, `"kind"`)
|
kindWasSupplied = strings.Contains(stdinEvent, `"kind"`)
|
||||||
}
|
}
|
||||||
kindWasSupplied = slices.Contains(c.FlagNames(), "kind")
|
|
||||||
|
|
||||||
if kind := c.Int("kind"); kindWasSupplied {
|
if kind := c.Int("kind"); slices.Contains(c.FlagNames(), "kind") {
|
||||||
evt.Kind = kind
|
evt.Kind = kind
|
||||||
mustRehashAndResign = true
|
mustRehashAndResign = true
|
||||||
|
} else if !kindWasSupplied {
|
||||||
|
evt.Kind = 1
|
||||||
|
mustRehashAndResign = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if content := c.String("content"); content != "" {
|
if content := c.String("content"); content != "" {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user