Initial import: imag-log
This commit is contained in:
parent
0c9c9e26c1
commit
7a364639ee
6 changed files with 116 additions and 0 deletions
|
@ -15,6 +15,7 @@ members = [
|
||||||
"bin/domain/imag-contact",
|
"bin/domain/imag-contact",
|
||||||
"bin/domain/imag-diary",
|
"bin/domain/imag-diary",
|
||||||
"bin/domain/imag-habit",
|
"bin/domain/imag-habit",
|
||||||
|
"bin/domain/imag-log",
|
||||||
"bin/domain/imag-mail",
|
"bin/domain/imag-mail",
|
||||||
"bin/domain/imag-notes",
|
"bin/domain/imag-notes",
|
||||||
"bin/domain/imag-timetrack",
|
"bin/domain/imag-timetrack",
|
||||||
|
|
33
bin/domain/imag-log/Cargo.toml
Normal file
33
bin/domain/imag-log/Cargo.toml
Normal 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" }
|
1
bin/domain/imag-log/README.md
Symbolic link
1
bin/domain/imag-log/README.md
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../../doc/src/04020-module-log.md
|
3
bin/domain/imag-log/src/main.rs
Normal file
3
bin/domain/imag-log/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
63
bin/domain/imag-log/src/ui.rs
Normal file
63
bin/domain/imag-log/src/ui.rs
Normal 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)."))
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
15
doc/src/04020-module-log.md
Normal file
15
doc/src/04020-module-log.md
Normal 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`.
|
||||||
|
|
Loading…
Reference in a new issue