diff --git a/Cargo.toml b/Cargo.toml index 6416893e..0a6bcdd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ members = [ "bin/domain/imag-contact", "bin/domain/imag-diary", "bin/domain/imag-habit", + "bin/domain/imag-log", "bin/domain/imag-mail", "bin/domain/imag-notes", "bin/domain/imag-timetrack", diff --git a/bin/domain/imag-log/Cargo.toml b/bin/domain/imag-log/Cargo.toml new file mode 100644 index 00000000..5c7a89ee --- /dev/null +++ b/bin/domain/imag-log/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "imag-log" +version = "0.6.0" +authors = ["Matthias Beyer "] + +description = "Part of the imag core distribution: imag-bookmark command" + +keywords = ["imag", "PIM", "personal", "information", "management"] +readme = "../../../README.md" +license = "LGPL-2.1" + +documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.html" +repository = "https://github.com/matthiasbeyer/imag" +homepage = "http://imag-pim.org" + +[badges] +travis-ci = { repository = "matthiasbeyer/imag" } +is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" } +is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" } +maintenance = { status = "actively-developed" } + +[dependencies] +clap = ">=2.17" +log = "0.3" +version = "2.0.1" +toml = "0.4" +toml-query = "^0.4" +is-match = "0.1" + +libimagrt = { version = "0.6.0", path = "../../../lib/core/libimagrt" } +libimagerror = { version = "0.6.0", path = "../../../lib/core/libimagerror" } +libimagdiary = { version = "0.6.0", path = "../../../lib/domain/libimagdiary" } +libimaglog = { version = "0.6.0", path = "../../../lib/domain/libimaglog" } diff --git a/bin/domain/imag-log/README.md b/bin/domain/imag-log/README.md new file mode 120000 index 00000000..5c9729e8 --- /dev/null +++ b/bin/domain/imag-log/README.md @@ -0,0 +1 @@ +../../../doc/src/04020-module-log.md \ No newline at end of file diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs new file mode 100644 index 00000000..e7a11a96 --- /dev/null +++ b/bin/domain/imag-log/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/bin/domain/imag-log/src/ui.rs b/bin/domain/imag-log/src/ui.rs new file mode 100644 index 00000000..c724395b --- /dev/null +++ b/bin/domain/imag-log/src/ui.rs @@ -0,0 +1,63 @@ +// +// imag - the personal information management suite for the commandline +// Copyright (C) 2015, 2016 Matthias Beyer and contributors +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; version +// 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + +use clap::{Arg, ArgGroup, App, SubCommand}; + +pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { + app + .arg(Arg::with_name("diaryname") + .long("to") + .short("t") + .takes_value(true) + .required(false) + .help("Use other than default diary")) + + .arg(Arg::with_name("text") + .index(1) + .takes_value(true) + .multiple(true) + .required(false) + .help("Text to log. Multiple will be concatenated") + .value_name("TEXT") + .value_names("TEXTS")) + + .subcommand(SubCommand::with_name("show") + .about("View log(s)") + .version("0.1") + + .arg(Arg::with_name("show-all") + .long("all") + .short("a") + .takes_value(false) + .required(false) + .conflicts_with("show-name") + .help("Show all logs")) + + .arg(Arg::with_name("show-name") + .index(1) + .takes_value(true) + .multiple(true) + .required(false) + .conflicts_with("show-all") + .help("Show logs. Multiple possible (will be sorted by date, still).")) + + ) + +} + diff --git a/doc/src/04020-module-log.md b/doc/src/04020-module-log.md new file mode 100644 index 00000000..b886391e --- /dev/null +++ b/doc/src/04020-module-log.md @@ -0,0 +1,15 @@ +## Log {#sec:modules:log} + +The "imag-log" module is a lightweight interface to the "imag-diary" command. + +It is intended as a tumbeblog-like diary, where one does not care to fire up +an editor and type in a long text, but rather type a few words and forget +about it: + +``` +imag log --to work "Copying large amounts of data takes time" +``` + +Everything which can be done with `imag-log` can also be done with +`imag-diary`. +