Closed tombh closed 1 month ago
sorry for a slow response, also I don't want to be too picky, but would it be possible in normal operation to dump one item per line, perhaps in csv or similar format? and json as some flag to it?
Although this PR does address the "latest synced file paths" issue in #11, it is actually providing a much broader feature in its support for "events". There are 32 distinct event types, you can read the details about each one here: https://docs.syncthing.net/dev/events.html#event-types Each event has is its own fields, many of which are nested. So there is no easy way to compact all event types into a single line.
Though even if it were, I would still suggest that JSON be the default data format. It is the lingua franca data structure of the command line. And so there are many tools that make it easy to convert JSON to other formats such as CSV. The most well-known of those tools is jq
. Here's a Stack Overflow answer giving examples of converting JSON to CSV: https://stackoverflow.com/questions/32960857/how-to-convert-arbitrary-simple-json-to-csv-using-jq
I would strongly argue against JSON as a default format. When you run ls
or ps
, read logs, events, or email, none are in json by default. Typically json or yaml output requires an extra output flags. Stc is meant to be a quick user friendly tool.
Anyhow I don't want to be picky and I will accept your PR and merge it, but I reserver right to re-work it in future in to a more user friendly output :)
Again thanks for your contribution!
Adds an
event
subcommand.For example
stc --limit 1 events LocalChangeDetected,RemoteChangeDetected