summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-25 19:34:08 +0200
committerMatthias Beyer <mail@beyermatthias.de>2018-11-11 13:16:42 +0100
commite6e683f2c126a1b947f8f6b36d1e355711e6f694 (patch)
treeac8c5b0eec49cdd9e93b74bfa7e1e8a33b625f97
parent5336077733e72e8c57b8c1954d7d1233ed2d6f63 (diff)
imag-flashcard: Initial import
-rw-r--r--Cargo.toml1
-rw-r--r--bin/domain/imag-flashcard/Cargo.toml40
l---------bin/domain/imag-flashcard/README.md1
-rw-r--r--bin/domain/imag-flashcard/src/main.rs74
-rw-r--r--bin/domain/imag-flashcard/src/ui.rs25
-rw-r--r--scripts/release.sh1
6 files changed, 142 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 56d2271..e91bcb8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,6 +19,7 @@ members = [
"bin/domain/imag-bookmark",
"bin/domain/imag-contact",
"bin/domain/imag-diary",
+ "bin/domain/imag-flashcard",
"bin/domain/imag-habit",
"bin/domain/imag-log",
"bin/domain/imag-mail",
diff --git a/bin/domain/imag-flashcard/Cargo.toml b/bin/domain/imag-flashcard/Cargo.toml
new file mode 100644
index 0000000..522477f
--- /dev/null
+++ b/bin/domain/imag-flashcard/Cargo.toml
@@ -0,0 +1,40 @@
+[package]
+name = "imag-flashcard"
+version = "0.8.0"
+authors = ["Matthias Beyer <mail@beyermatthias.de>"]
+
+description = "Part of the imag core distribution: imag-flashcard command"
+
+keywords = ["imag", "PIM", "personal", "information", "management"]
+readme = "../../../README.md"
+license = "LGPL-2.1"
+
+documentation = "https://imag-pim.org/doc/"
+repository = "https://github.com/matthiasbeyer/imag"
+homepage = "http://imag-pim.org"
+
+build = "../../../build.rs"
+
+[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]
+log = "0.4.0"
+
+libimagerror = { version = "0.8.0", path = "../../../lib/core/libimagerror" }
+libimagstore = { version = "0.8.0", path = "../../../lib/core/libimagstore" }
+libimagrt = { version = "0.8.0", path = "../../../lib/core/libimagrt" }
+libimagflashcard = { version = "0.8.0", path = "../../../lib/domain/libimagflashcard" }
+libimagentryedit = { version = "0.8.0", path = "../../../lib/entry/libimagentryedit" }
+libimagentryview = { version = "0.8.0", path = "../../../lib/entry/libimagentryview" }
+libimaginteraction = { version = "0.8.0", path = "../../../lib/etc/libimaginteraction" }
+libimagutil = { version = "0.8.0", path = "../../../lib/etc/libimagutil" }
+
+[dependencies.clap]
+version = "^2.29"
+default-features = false
+features = ["color", "suggestions", "wrap_help"]
+
diff --git a/bin/domain/imag-flashcard/README.md b/bin/domain/imag-flashcard/README.md
new file mode 120000
index 0000000..4e7b5b2
--- /dev/null
+++ b/bin/domain/imag-flashcard/README.md
@@ -0,0 +1 @@
+../../../doc/src/04020-module-flashcards.md \ No newline at end of file
diff --git a/bin/domain/imag-flashcard/src/main.rs b/bin/domain/imag-flashcard/src/main.rs
new file mode 100644
index 0000000..58b45c4
--- /dev/null
+++ b/bin/domain/imag-flashcard/src/main.rs
@@ -0,0 +1,74 @@
+//
+// imag - the personal information management suite for the commandline
+// Copyright (C) 2015-2018 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,
+)]
+
+#[macro_use] extern crate log;
+extern crate clap;
+
+#[macro_use] extern crate libimagrt;
+extern crate libimagentryedit;
+extern crate libimagentryview;
+extern crate libimagerror;
+extern crate libimagflashcard;
+extern crate libimaginteraction;
+extern crate libimagstore;
+extern crate libimagutil;
+
+use libimagrt::setup::generate_runtime_setup;
+use libimagrt::runtime::Runtime;
+use libimagerror::trace::MapErrTrace;
+
+fn main() {
+ let version = make_imag_version!();
+ let rt = generate_runtime_setup("imag-flashcard",
+ &version,
+ "Flashcard learning",
+ ui::build_ui);
+
+ rt.cli()
+ .subcommand_name()
+ .map(|name| {
+ debug!("Call {}", name);
+ match name {
+ // TODO
+ other => {
+ debug!("Unknown command");
+ let _ = rt.handle_unknown_subcommand("imag-flashcard", other, rt.cli())
+ .map_err_trace_exit_unwrap(1)
+ .code()
+ .map(::std::process::exit);
+ },
+ }
+ });
+}
+
diff --git a/bin/domain/imag-flashcard/src/ui.rs b/bin/domain/imag-flashcard/src/ui.rs
new file mode 100644
index 0000000..1b57ca7
--- /dev/null
+++ b/bin/domain/imag-flashcard/src/ui.rs
@@ -0,0 +1,25 @@
+//
+// imag - the personal information management suite for the commandline
+// Copyright (C) 2015-2018 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
+}
+
diff --git a/scripts/release.sh b/scripts/release.sh
index 0d971bb..8238071 100644
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -48,6 +48,7 @@ CRATES=(
./bin/domain/imag-todo
./bin/domain/imag-log
./bin/domain/imag-wiki
+ ./bin/domain/imag-flashcard
./bin/core/imag-ref
./bin/core/imag-gps
./bin/core/imag-diagnostics