diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-05-27 16:10:00 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-05-27 17:07:13 -0400 |
| commit | 9dc5d4799dce590e0bfb334f6cf47fc1fad47618 (patch) | |
| tree | c39f756af1493d94c59fc107c3d7a342203b8d25 /cmd/x | |
| parent | 8c733ff3bf72d6eef88487b6f3d0408025d1b13d (diff) | |
| download | x-9dc5d4799dce590e0bfb334f6cf47fc1fad47618.tar.xz x-9dc5d4799dce590e0bfb334f6cf47fc1fad47618.zip | |
cmd/mi: optionally syndicate events to flyghttracker
Depends on superfly/flyght-tracker#2
Diffstat (limited to 'cmd/x')
| -rw-r--r-- | cmd/x/mi.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/x/mi.go b/cmd/x/mi.go index ba183ff..71bd57f 100644 --- a/cmd/x/mi.go +++ b/cmd/x/mi.go @@ -188,12 +188,13 @@ type miAddEvent struct { endDate string location string description string + syndicate bool } func (*miAddEvent) Name() string { return "add-event" } func (*miAddEvent) Synopsis() string { return "Add an event to be attended." } func (*miAddEvent) Usage() string { - return `add-event [--name] [--url] [--start-date] [--end-date] [--location] [--description]: + return `add-event [--name] [--url] [--start-date] [--end-date] [--location] [--description] [--syndicate]: Add an event to be attended. ` } @@ -204,6 +205,7 @@ func (ae *miAddEvent) SetFlags(f *flag.FlagSet) { f.StringVar(&ae.endDate, "end-date", "", "End date of the event.") f.StringVar(&ae.location, "location", "", "Location of the event.") f.StringVar(&ae.description, "description", "", "Description of the event.") + f.BoolVar(&ae.syndicate, "syndicate", false, "Syndicate this event to other services.") } func (ae *miAddEvent) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { @@ -292,6 +294,7 @@ func (ae *miAddEvent) Execute(ctx context.Context, f *flag.FlagSet, _ ...interfa EndDate: timestamppb.New(endDate), Location: ae.location, Description: ae.description, + Syndicate: ae.syndicate, } slog.Info("adding event", "event", ev) |
