72e50fd3Fix timeout calculation applied in inverted way
That fucking variable negates timezone offset for some unknown reason
(probably American programming this time too.)
Shota FUJI
authored at
Shota FUJI
comitted at
200c24e2Fix test changes its snapshot day to day
Due to lack of "--from", test result differs depends on the date test
ran.
Shota FUJI
authored at
Shota FUJI
comitted at
c60756e3Remove snapshot test for "version" command
It was there as a demo.
Shota FUJI
authored at
Shota FUJI
comitted at
f690ac25Add "--from" option to "list" command
It was nearly impossible to test due to reference to the system time.
Shota FUJI
authored at
Shota FUJI
comitted at
08f471e4Setup snapshot testings
Behavior matching tests is helpful, but it prevents me from adding,
changing or improving existing functionality. Snapshot testing solves
this problem. Here is my plan:
1. Add a way to fix time (new CLI arg or C API something)
2. Create snapshots for behavior matching tests
3. Delete behavior matching tests
This file-based snapshotting works great with external tools. In a
future when I add a structured output (e.g. JSON,) difftastic would help
diff-ing a lot.
The reason I choose "version" command is it does not rely on system
time. Even "report" command prints current time to output and that
messes snapshot testing up.
Shota FUJI
authored at
Shota FUJI
comitted at
4cc8a62fE2E testing
As I'm going to add features and changes to existing behavior, tests not
bound to legacy program is necessary.
Shota FUJI
authored at
Shota FUJI
comitted at
7d352678Add --date option to report command
It supersedes "y", "m" and "d" options.
I'm yet to decide it should be positional or labelled, so CLI currently
accepts both.
Shota FUJI
authored at
Shota FUJI
comitted at
18912188Separate arg parser code into several files
It was not easy to read, and I'm going to add more logic to arg parsers.
Shota FUJI
authored at
Shota FUJI
comitted at
8f2024a8Update man pages to the new CLI
Previous CLI don't fit well to man page format, especially due to its
hyphen-less semi-positional sometimes-ignored options.
Shota FUJI
authored at
Shota FUJI
comitted at
024f9127Fix prints "unknown argument" for incorrect arguments
Errors other than UnknownArg, such as MissingValue logs eariler.
UnknownArg is also used as a "skip" signal and there were no other error
in an error set, that's why the log was here. I simply forgot to remove
that when I added other error values.
Shota FUJI
authored at
Shota FUJI
comitted at
64f0da64Event type arguments for list command
I initially thought these args affects every command. Turned out, only
"list" and "wait" commands use those args. That's why I set those as
command options rather than global options. This time, I choose
correctness and user-friendliness over backwards-compatibility.
Shota FUJI
authored at
Shota FUJI
comitted at
1927160cFix incorrect sunrise/sunset calculation on non-UTC timezone
Shota FUJI
authored at
Shota FUJI
comitted at
304fec8bFix invalid CLI argument does not abort parsing
Invalid argument, such as "d foo" should abort and prints usage error.
Shota FUJI
authored at
Shota FUJI
comitted at
4a52d259Run "print_list" on "list" command
It does not work correctly because the default value of `target_time`
being the same as `now` instead of "start of the day of `now`."
Anyway, the command prints something and exits with expected status.
That's okay for now.
Shota FUJI
authored at
Shota FUJI
comitted at
66781b3dFix lat/lon accepts negative number with suffix
Values like -1.2345N are illegal and confusing. As I've added
"--latitude" and "--longitude" options, there are no need for supporting
negative suffixed values.
Shota FUJI
authored at
Shota FUJI
comitted at
c5402dc6Add --latitude and --longitude options
This is obvious and less error-prone. I'm gonna keep non-flag variants
for compatibility.
Shota FUJI
authored at
Shota FUJI
comitted at
74ebda97Defer getting now/target time
CLI does not take argument for "now". Also "target" defaults to "now".
Shota FUJI
authored at
Shota FUJI
comitted at
8249d378UTC flag
Instead of "--utc" being an alias for "--gmt", I swapped those too.
Shota FUJI
authored at
Shota FUJI
comitted at
d3848966Debug flag
I did not added "verbose" alias because it's incorrect--the "debug" flag
shortens wait time and that's not "verbose" or not. Shortening wait time
is not appropriate for "--debug" too, but never it is verbosity.
The original version also has "-v" alias in flag handling code, but it
won't be handled because "version" flag has "-v" alias and it captures
the arg eariler.
Shota FUJI
authored at
Shota FUJI
comitted at
0f68071eSkip tests for features not implemented yet
Errors are so noisy.
Shota FUJI
authored at
Shota FUJI
comitted at
c6acef26Add behavior matching tests to build system
This allows me to develop new CLI main in a more TDD-ish way.
Shota FUJI
authored at
Shota FUJI
comitted at
8ffc19d7Add Zig main
The most painful point of this software is it's CLI design. Unstructured
flags and surprising behaviors. The biggest reason I forked is to
rewrite the CLI frontend.
Shota FUJI
authored at
Shota FUJI
comitted at
b4e9177aRemove unused annotation from REUSE.toml
The REUSE tool won't complain unexistent file path, though.
This is just a cleanup.
Shota FUJI
authored at
Shota FUJI
comitted at
2af7c1d7Man page for sunwait(1)
It is more readable than plain text and more familiar to many people.
Shota FUJI
authored at
Shota FUJI
comitted at
ceec2038Configure Zig build system
I hate C toolchains. I mean, cryptic warnings and errors they outputs.
My current plan is to gradually replacing C with Zig, starting from
"main" function.
Shota FUJI
authored at
Shota FUJI
comitted at
5e88a06bCreate copyright and license file for current files
File format and directory structure follows REUSE 3.3 specification.
<https://reuse.software/spec-3.3/>
Copyright texts are from actual source code. README file does not
include neither copyright nor license text. I choose GPL-3.0-only rather
than GPL-3.0-or-later because:
* no file but LICENSE contains "or any later version", which indicates
GPL-3.0-or-later
* GPL-3.0-only looks safer, as GPL-3.0-or-later technically widens
license without copyright holder's permission.
I plan to gradually rewrite/replace every file so...I hope I can remove
this REUSE.toml file in a future.
Shota FUJI
authored at
Shota FUJI
comitted at
d750d22cMerge pull request #29 from linuxkidd/master
Fix unused computed valued warning during sunwait.cpp compile.Daniel Risacher
authored at
GitHub
comitted at
39a8d864Merge pull request #31 from ckuethe/patch-1
document use of an arbitrary date specificationDaniel Risacher
authored at
GitHub
comitted at
e552a206Merge pull request #28 from allanlaal/patch-1
ADD standard(ish) unixy command line flagsDaniel Risacher
authored at
GitHub
comitted at
102cb417Merge pull request #7 from kadorken/master
Add build procedure/solution for windows and linux in visual studio 2019Daniel Risacher
authored at
GitHub
comitted at
5facc0eeMerge pull request #11 from ahorn42/master
Fix for make clean error, if the folder was already deleted or not yet createdDaniel Risacher
authored at
GitHub
comitted at
8b33f470Merge pull request #9 from danieldjewell/fix_report_targetTime
Fix error in print.cpp in displaying target timeDaniel Risacher
authored at
GitHub
comitted at
58d7db58Merge pull request #8 from hardija/master
Fixed typo "Diurnal"Daniel Risacher
authored at
GitHub
comitted at
81cb0da8Merge pull request #13 from lbdroid/master
Add Makefile and instructions for OpenWRTDaniel Risacher
authored at
GitHub
comitted at
973ac45eMerge pull request #15 from tljohnsn/master
Fix build errors on osxDaniel Risacher
authored at
GitHub
comitted at
6f738fd1Fix error in print.cpp in displaying target time
The "nowTm" struct was being used for the target time data in report
Daniel Jewell
authored at
Daniel Jewell
comitted at
c10f2538added -f to rm, to avoid errors if the sunwait folder was already removed or is not existent
Andreas Horn
authored at
Andreas Horn
comitted at