void main, clarify readme

This commit is contained in:
yosh 2024-01-27 20:16:29 -05:00
parent dd84304530
commit 0491250ad7
2 changed files with 4 additions and 2 deletions

View File

@ -17,7 +17,9 @@ bson2json < bson_file.bson > json_file.json
bsonurl=$(curl https://some.server/api.php | jq -r '.link.filter')
curl "$bsonurl" | bson2json | jq -r '.filter.to.a.specific.value'
```
`bson2json` has *very minimal* error checking. it assumes that the bson files you give it will be valid. it doesn't tell you what byte errors occur (that'd be weird). if an unrecoverable error occurs, the exit code will be nonzero. as such, if you're not 100% sure that the bson files you are giving it will be valid, perhaps have a setup like so:
`bson2json` has *very minimal* error checking. it assumes that the bson files you give it will be valid. it doesn't tell you what byte errors occur (that'd be weird). if an unrecoverable error occurs, the exit code will be nonzero.
additionally, `bson2json` does *not* buffer any input. if an error occurs halfway through, the output will be cut off json. as such, if you're not 100% sure that the bson files you are giving it will be valid, perhaps have a setup like so:
```
bson2json < bson_file.bson >/dev/null && bson2json < bson_file.bson | jq 'some_filter'
```

View File

@ -236,7 +236,7 @@ print_bson(uint8_t is_array)
}
int
main(int argc, char **argv)
main(void)
{
print_bson(0);
printf("\n");