summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2018-04-03Add helper for handling unknown subcommandsMatthias Beyer
2018-03-26Fix: Entry::to_str() should return Result<_>Matthias Beyer
Because serializing might fail. Also fixes all usages of the API.
2018-03-23Rewrite edit_in_tmpfile() for new Runtime::editor() signatureMatthias Beyer
2018-03-23Fix: Pass /dev/tty as stdin for editorMatthias Beyer
This fixes the issue that spawning the editor trashes the terminal. The signature of the Runtime::editor() function changed, which has to be fixed in using code.
2018-03-23Add header editing supportMatthias Beyer
2018-03-23Add Entry::replace_from_buffer()Matthias Beyer
2018-03-23Add debugging output if kairos fails to parse inputMatthias Beyer
2018-03-23Add debug outputMatthias Beyer
2018-03-23Use "ui" module in libimagtimeuiMatthias Beyer
2018-03-23Add message why panicMatthias Beyer
So we see that when grepping the source for `unimplemented!()`.
2018-03-23Merge pull request #1360 from matthiasbeyer/libimaghabit/create-vs-retrieveMatthias Beyer
Fix: Use retrieve in retrieve variant
2018-03-23Merge pull request #1356 from matthiasbeyer/libimaghabit/link-new-instancesMatthias Beyer
Fix: libimaghabit::habit::HabitTemplate should link created instances…
2018-03-22Merge pull request #1355 from matthiasbeyer/libimagstore/create-semantic-fixMatthias Beyer
Fix: Store::create() should fail if the entry exists
2018-03-22Fix: Use retrieve in retrieve variantMatthias Beyer
2018-03-22Fix: libimaghabit::habit::HabitTemplate should link created instances to the ↵Matthias Beyer
template
2018-03-22Merge pull request #1357 from matthiasbeyer/libimaghabit/create-vs-retrieveMatthias Beyer
Libimaghabit/create vs retrieve
2018-03-22Fix: Store::create() should fail if the entry existsMatthias Beyer
2018-03-22Merge pull request #1354 from matthiasbeyer/libimaghabit/check-is-done-for-dateMatthias Beyer
Add helper to check whether an instance exists for a date
2018-03-22Refactor for less verbose codeMatthias Beyer
2018-03-22Dedup codeMatthias Beyer
2018-03-22Add "retrieve" variants for retrieving instancesMatthias Beyer
and fix create implementation to use `Store::create()`, which did the wrong thing.
2018-03-22Add helper to check whether an instance exists for a dateMatthias Beyer
2018-03-21Merge pull request #1349 from matthiasbeyer/libimagentryref/fixesMatthias Beyer
Fix: Allocating of buffer does not work as expected with Vec::with_ca…
2018-03-20Fix: Allocating of buffer does not work as expected with Vec::with_capacity()Matthias Beyer
2018-03-19Provide Ref::make_ref() for making a ref out of an existing entryMatthias Beyer
2018-03-13Ensure command and args are provided correctlyMatthias Beyer
2018-03-13Read editor from configuration, ignore errorsMatthias Beyer
2018-03-12Merge pull request #1342 from ↵Matthias Beyer
matthiasbeyer/libimagentryedit/fix-editor-stdinerr-inherit libimagentryedit: fix editor stdinerr inherit
2018-03-12Fix editor commandMatthias Beyer
do inherit stdin and stderr from parent process, to not break terminal editors when editing stuff. vim printed "Input not from terminal" warning messages. This was fixed by this commit.
2018-03-12Simplify error handling by using linking feature of error-chainMatthias Beyer
2018-03-12Add type so that we can serialize a VcardMatthias Beyer
2018-03-12Merge pull request #1334 from matthiasbeyer/libimagcontact/ref-from-uidMatthias Beyer
Change ref creation to use UID from vcard object
2018-03-12Merge pull request #1324 from matthiasbeyer/minorMatthias Beyer
Minor patches
2018-03-12Change ref creation to use UID from vcard objectMatthias Beyer
2018-03-12Merge pull request #1332 from matthiasbeyer/libimagcontact/all-contactsMatthias Beyer
Implement ContactStore::all_contacts()
2018-03-12Fix typoMatthias Beyer
2018-03-12Fix: use Path::file_stem() instead of Path::file_name()Matthias Beyer
Because we don't want to know the extension of the filename here.
2018-03-12Implement ContactStore::all_contacts()Matthias Beyer
2018-03-10Merge pull request #1330 from matthiasbeyer/libimagrt/pipe-magicMatthias Beyer
Implement pipe magic in libimagrt
2018-03-10Implement pipe magic in libimagrtMatthias Beyer
When we merged the changes in libimagrt so that it automatically detects whether stdin/stdout is a TTY and provides the user with stderr in case stdout is not a TTY, we forgot that things like imag foo | grep bar becomes impossible with that, because imag detects that stdout is not a tty and automatically uses stderr for output. But in this case, we don't want that. The output has to be stdout in this case. With this change, we have a flag in the runtime ("--pipe-magic" or "-P", globally available) which turns on "pipe magic". The expected behaviour is the following, if "-P" is passed: * If stdout is a TTY, we print to stdout * If stdout is not a TTY, we print to stderr * If stdin is not a TTY, we do not provide it If "-P" is not passed, we allow the user of libimagrt to use stdin for interactive stuff (the interactive stuff is not yet implemented). Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-03-10This fixes the file parsing (again)Matthias Beyer
Unfortunately, our latest fix to file parsing did not solve all issues. So we have to fix it _again_. The problem was the `std::str::Lines` iterator, which apparently fails this: assert_eq!(1, "".lines().count()); as an empty line seems not to be a line. Because of that, when reading a file with an empty line at its bottom got stripped off that line. This patch removes the use of the `lines()` iterator and uses `split("\n")` instead. This only works on Unix operating systems, but as we only target unix operating systems with imag, this is not considered an issue right now. This patch also adds extensive tests on multiple levels in the `libimagstore` implementation: * On the parsing level, for the function which implements the parsing * On the filesystem abstraction levels * On the `Store` levels to make sure that everything is parsed correctly.
2018-03-06Replace hard coded version strings with compiletime envMatthias Beyer
2018-03-04Provide LockedOutputProxy which holds locked variants of Stdout/StderrMatthias Beyer
2018-03-04Let the OutputProxy hold Stdout/Stderr objects, so we do not have to aquire ↵Matthias Beyer
them each write!()
2018-03-04Implement proxy object where runtime configures outputMatthias Beyer
This is another approach for providing access to stdin/out/err via libimagrt::runtime::Runtime. The Runtime object does configure which output gets returned (stdout if stdout is a tty, else stderr). With this we can change libimagrt to read/write the store from/to stdin/stdout without the user noticing that she does not write to stdout but stderr. Reading from stdin is not possible then, though.
2018-03-04Provide stdin/out/err resources via Runtime objectMatthias Beyer
This way we can control whether "out" output goes to stdout or stderr without the user of the functionality knowing. This is useful for later when we use libimagrt to automatically read and write the store from and to stdout/in depending on whether we are talking to a TTY or a pipe.
2018-03-03Merge pull request #1321 from ↵Matthias Beyer
matthiasbeyer/libimagdiary/not-on-retrieve-for-module libimagdiary: Do not rely on Store::retrieve_for_module
2018-03-02Merge pull request #1314 from matthiasbeyer/imag/do-not-instantiate-runtimeMatthias Beyer
Change "imag" impl to not instantiate Runtime object
2018-03-02Fix multi-line readingMatthias Beyer
Reading entries with multiple entries caused all lines to be read as one line. This bug is fixed with this patch.
2018-03-02Add testcase for reading multiple linesMatthias Beyer