Import crate for imag-habit

This commit is contained in:
Matthias Beyer 2017-10-21 14:12:21 +02:00
parent 840bc86c90
commit be79f6373e
5 changed files with 157 additions and 0 deletions

View File

@ -14,6 +14,7 @@ members = [
"bin/domain/imag-bookmark",
"bin/domain/imag-contact",
"bin/domain/imag-diary",
"bin/domain/imag-habit",
"bin/domain/imag-mail",
"bin/domain/imag-notes",
"bin/domain/imag-timetrack",

View File

@ -0,0 +1,33 @@
[package]
name = "imag-habit"
version = "0.5.0"
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
description = "Part of the imag core distribution: imag-habit 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"
[dependencies]
chrono = "0.4"
version = "2.0"
clap = ">=2.17"
log = "0.3"
toml = "0.4"
toml-query = "^0.4"
kairos = "0.1.0-beta-2"
libimagerror = { version = "0.5.0", path = "../../../lib/core/libimagerror" }
libimagstore = { version = "0.5.0", path = "../../../lib/core/libimagstore" }
libimagrt = { version = "0.5.0", path = "../../../lib/core/libimagrt" }
libimagentryedit = { version = "0.5.0", path = "../../../lib/entry/libimagentryedit" }
libimaginteraction = { version = "0.5.0", path = "../../../lib/etc/libimaginteraction" }
libimagutil = { version = "0.5.0", path = "../../../lib/etc/libimagutil" }
libimagtimeui = { version = "0.5.0", path = "../../../lib/etc/libimagtimeui" }
libimaghabit = { version = "0.5.0", path = "../../../lib/domain/libimaghabit" }

View File

@ -0,0 +1,98 @@
//
// 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
//
#![deny(
non_camel_case_types,
non_snake_case,
path_statements,
trivial_numeric_casts,
unstable_features,
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,
)]
extern crate clap;
#[macro_use] extern crate log;
#[macro_use] extern crate version;
extern crate toml;
extern crate toml_query;
extern crate kairos;
extern crate libimaghabit;
extern crate libimagstore;
extern crate libimagrt;
extern crate libimagerror;
extern crate libimagutil;
use std::process::exit;
use libimagrt::runtime::Runtime;
use libimagrt::setup::generate_runtime_setup;
use libimagerror::trace::{MapErrTrace, trace_error};
use libimaghabit::store::HabitStore;
use libimaghabit::habit::builder::HabitBuilder;
use libimaghabit::habit::HabitTemplate;
mod ui;
fn main() {
let rt = generate_runtime_setup("imag-habit",
&version!()[..],
"Habit tracking tool",
ui::build_ui);
rt.cli()
.subcommand_name()
.map(|name| {
debug!("Call {}", name);
match name {
"create" => create(&rt),
"delete" => delete(&rt),
"list" => list(&rt),
"show" => show(&rt),
_ => {
debug!("Unknown command"); // More error handling
exit(1)
},
}
});
}
fn create(rt: &Runtime) {
unimplemented!()
}
fn delete(rt: &Runtime) {
unimplemented!()
}
fn list(rt: &Runtime) {
unimplemented!()
}
fn show(rt: &Runtime) {
unimplemented!()
}

View File

@ -0,0 +1,24 @@
//
// 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, App, SubCommand};
pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
app
}

View File

@ -34,6 +34,7 @@ This section contains the changelog from the last release to the next release.
Specifying an editor either via CLI or via the `$EDITOR` environment
variable still possible.
* `imag-contact` was added (with basic contact support so far).
* `imag-habit` was introduced
* Minor changes
* `libimagentryannotation` got a rewrite, is not based on `libimagnotes`