mvertes / txt2man

txt2man converts text to man page
GNU General Public License v2.0
57 stars 10 forks source link

Fix usage of the date command on BSD systems #19

Closed ismaell closed 4 years ago

ismaell commented 4 years ago

BSD and GNU implementations of the date command are slightly incompatible.

The GNU implementation can take an arbitrary date with the -d option, and the format is automatically detected, but on BSD implementations it must be invoked like for setting the system date but using the -j option to avoid that step, and the input format must be provided with the -f option.

Since the -j option isn't supported by the GNU implementation, it can be exploited to detect which variant the system uses.

See: https://github.com/axel-download-accelerator/axel/commit/3f6ad06194782ded0eba621aa8ff8fe52d41280c#diff-67e997bcfdac55191033d57a16d1408a