-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Machine readable (json) output of --version #371
Comments
Seems useful. I've done something quick in rsync patches to be refined for future inclusion. |
Great to hear. Can you please show me an example output of it? Or do you have a nightly build or a rep I can build from without adding patch diff filesß |
{
"program": "rsync",
"version": "3.2.6-10-gad53a9b5",
"protocol": "31.0",
"copyright": "(C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.",
"url": "https://rsync.samba.org/",
"capabilities": {
"file_bits": 64, "inum_bits": 64, "timestamp_bits": 64,
"long_int_bits": 64, "socketpairs": true, "symlinks": true,
"symtimes": true, "hardlinks": true, "hardlink_specials": true,
"hardlink_symlinks": true, "IPv6": true, "atimes": true,
"batchfiles": true, "inplace": true, "append": true, "ACLs": true,
"xattrs": true, "secluded_args": "optional", "iconv": true,
"prealloc": true, "stop_at": true, "crtimes": false
},
"optimizations": {
"SIMD_roll": true, "asm_roll": true, "openssl_crypto": true,
"asm_MD5": false
},
"checksum_list": [
"xxh128", "xxh3", "xxh64", "md5", "md4", "sha1", "sha256", "sha512", "none"
],
"compress_list": [
"zstd", "lz4", "zlibx", "zlib", "none"
],
"daemon_auth_list": [
"sha512", "sha256", "sha1", "md5", "md4"
],
"license": "GPL3",
"caveat": "rsync comes with ABSOLUTELY NO WARRANTY"
} |
Thank you so much. |
FYI, this will be in 3.2.7pre pretty soon, so it will be in the github builds and in the rsync binaries dirs soon. |
In the latest git, see the script |
FYI, I changed capabilities & optimizations into dictionaries so that someone doesn't need to scan a list for "no crtimes" vs "crtimes". That's now |
Just a sidenote: Version 3.2.3 (Debian stable) still overs a Makes a bit hard to detect the json-supporting version of rsync because I can not be sure that |
The output is a lot longer when The python script is provided as a way to get the json output no matter what the rsync version is. Install the script somewhere and run the equivalent of |
Yes I know. And I have to add checks for that in my code now. And I also found out that What I know so far now
But I won't ship my application with such a script but implement that in my own code.. At the end I have to parse the output. In my current code I try to extract the rsync version in different ways.
Please feel free to use my code in replacement of your script. See |
Doing
rsync --version
displays on stdoutThis is human- but not machine-readable. Parsing this is possible but not elegant. Would be nice to have a
--json
to print out something like thisThe text was updated successfully, but these errors were encountered: