Initial import: imag-log

This commit is contained in:
Matthias Beyer 2017-12-08 11:27:13 +01:00
parent 0c9c9e26c1
commit 7a364639ee
6 changed files with 116 additions and 0 deletions

View File

@ -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",

View File

@ -0,0 +1,33 @@
[package]
name = "imag-log"
version = "0.6.0"
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
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" }

View File

@ -0,0 +1 @@
../../../doc/src/04020-module-log.md

View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

View File

@ -0,0 +1,63 @@
//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> 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)."))
)
}

View File

@ -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`.