Switch to using 'sequence'-delineated arguments given to the subprocess
run call to correctly handle whitespace.
Also check the output, so we exit if we have an error.
Test accordingly.
We regressed quiet into requiring a value to be set as a cli option
(`--quiet=true`) instead of just functioning as a flag (`--quiet`). This
change restores the previous interface on the command line,
and adds a test to ensure no regressions.
Previously, when parsing config options that were set to 'false',
e.g. `TOPEN_NOTES_QUIET=false` in the env vars,
we would still be setting it to true.
This change fixes any falsy value to be correctly parsed as False.
Turned annotation adding into a separate (pure) checking function to see
if we have to add an annotation, and a (side-effect) function which
actually adds it.
This way we can decouple checking and send an info to io only if it is
necessary while keeping the two tasks of checking and adding separate.
Since we can set the type of the relevant option in the OPTIONS dict, we
should also let the cli correctly cast them on parsing, just as the env
options do.
Main function instead returns the given error code and only when invoked
as a cli script will we use the error code to exit with the
corresponding code to the shell.
To start streamlining the TConf class a little, by removing some
internal logic which may be better residing in the Options dict,
we extract determining the correct taskrc file.
When the user exits the note-writing editor process without having
written any file, we also don't attach an annotation to the
corresponding task since it would lead nowhere.
This small change makes this condition obvious to the user, by informing
them that the program is 'doing nothing' when they exit the editor
without having saved a file.
Removed the property setters and getters from variables with complex
defaults. Instead, they are now given a specific const default value
`Path("%%%%I_DONT_EXIST_%%%%")` which is very unlikely to be used by a user
in normal circumstances.
This is necessary to be able to remove the properties since Python does
not distinguish between an empty Path() and a non-given Path() (i.e.
there is no Path value which returns Falsy).
However, this slightly clunky construct does allow setting the various
Paths once and only once, and also to remove all the previously
necessary getters and setters with their hidden backing variables.
Lastly it should open the gates for changing the _real_path
transformation to be part of the TConf class itself and not a global
function.
Necessary for CHANGELOG to pass since every change contains something
like 'Added', 'Fixed', 'Changed' as headings.
Will still error if there are e.g. multiple 'Added' headings for a
single version.