hzeller / txtempus

A DCF77, WWVB, JJY and MSF clock LF-band signal transmitter using the Raspberry Pi
GNU General Public License v3.0
441 stars 71 forks source link

Add version option #27

Open pjueon opened 2 years ago

pjueon commented 2 years ago
  1. Added --version option to the txtempus.

Usage:

txtempus --version

Output:

txtempus 1.0.0.0

Added hard-coded version info for now, but is possible to generate the version.h on build using the version info in the CMakeLists.txt in the future.

  1. Minor refactoring

Created UserInput class. It handles all the user input now.

pjueon commented 2 years ago

@hzeller Could you check this please?

hzeller commented 2 years ago

Not sure if the added complexity is worth for a --version option of a project that is likely to not really change much.

pjueon commented 2 years ago

@hzeller Sorry for the late response.

For example, let's say you want to implement txtempus on the devices like arduino.
And you may not be able to use a keyboard and have to use other input devices (like buttons or something). In this scenario, I think it's a good idea to encapsulate the I/O logic and separate it from the main function. It would be easier to edit the I/O part of the program.

But if you don't agree with me, I can revert the I/O part and minimize the change. Let me know your opinion. Thanks.