From 8379c3b5e5402feb0fa7bac20376b16af3f31845 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 26 Jun 2017 17:47:12 +0200 Subject: [PATCH] Add modules for functionality --- imag-timetrack/src/cont.rs | 25 +++++++++++++++++++ imag-timetrack/src/day.rs | 25 +++++++++++++++++++ imag-timetrack/src/main.rs | 49 ++++++++++++++++++++++++++++++++++++- imag-timetrack/src/month.rs | 25 +++++++++++++++++++ imag-timetrack/src/start.rs | 23 +++++++++++++++++ imag-timetrack/src/stop.rs | 23 +++++++++++++++++ imag-timetrack/src/track.rs | 25 +++++++++++++++++++ imag-timetrack/src/week.rs | 25 +++++++++++++++++++ imag-timetrack/src/year.rs | 25 +++++++++++++++++++ 9 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 imag-timetrack/src/cont.rs create mode 100644 imag-timetrack/src/day.rs create mode 100644 imag-timetrack/src/month.rs create mode 100644 imag-timetrack/src/start.rs create mode 100644 imag-timetrack/src/stop.rs create mode 100644 imag-timetrack/src/track.rs create mode 100644 imag-timetrack/src/week.rs create mode 100644 imag-timetrack/src/year.rs diff --git a/imag-timetrack/src/cont.rs b/imag-timetrack/src/cont.rs new file mode 100644 index 00000000..4700485c --- /dev/null +++ b/imag-timetrack/src/cont.rs @@ -0,0 +1,25 @@ +// +// 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 libimagrt::runtime::Runtime; + +pub fn cont(rt: &Runtime) -> i32 { + unimplemented!() +} + diff --git a/imag-timetrack/src/day.rs b/imag-timetrack/src/day.rs new file mode 100644 index 00000000..0c3fdcd1 --- /dev/null +++ b/imag-timetrack/src/day.rs @@ -0,0 +1,25 @@ +// +// 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 libimagrt::runtime::Runtime; + +pub fn day(rt: &Runtime) -> i32 { + unimplemented!() +} + diff --git a/imag-timetrack/src/main.rs b/imag-timetrack/src/main.rs index 134ff3d6..c396e19a 100644 --- a/imag-timetrack/src/main.rs +++ b/imag-timetrack/src/main.rs @@ -17,8 +17,55 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +mod cont; +mod day; +mod month; +mod start; +mod stop; +mod track; mod ui; +mod week; +mod year; + +use cont::cont; +use day::day; +use month::month; +use start::start; +use stop::stop; +use track::track; +use ui::build_ui; +use week::week; +use year::year; + +use libimagrt::setup::generate_runtime_setup; fn main() { - println!("Hello, world!"); + let rt = generate_runtime_setup("imag-timetrack", + &version!()[..], + "Time tracking module", + build_ui); + + let command = rt.cli().subcommand_name(); + let retval = if let Some(command) = command { + debug!("Call: {}", command); + match command { + "continue" => cont(&rt), + "day" => day(&rt), + "month" => month(&rt), + "start" => start(&rt), + "stop" => stop(&rt), + "track" => track(&rt), + "week" => week(&rt), + "year" => year(&rt), + _ => { + error!("Unknown command"); + 1 + }, + } + } else { + error!("No command"); + 1 + }; + + ::std::process::exit(retval); } diff --git a/imag-timetrack/src/month.rs b/imag-timetrack/src/month.rs new file mode 100644 index 00000000..61d974d7 --- /dev/null +++ b/imag-timetrack/src/month.rs @@ -0,0 +1,25 @@ +// +// 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 libimagrt::runtime::Runtime; + +pub fn month(rt: &Runtime) -> i32 { + unimplemented!() +} + diff --git a/imag-timetrack/src/start.rs b/imag-timetrack/src/start.rs new file mode 100644 index 00000000..6926eb38 --- /dev/null +++ b/imag-timetrack/src/start.rs @@ -0,0 +1,23 @@ +// +// 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 +// + +pub fn start(rt: &Runtime) -> i32 { + unimplemented!() +} + diff --git a/imag-timetrack/src/stop.rs b/imag-timetrack/src/stop.rs new file mode 100644 index 00000000..61ca02a8 --- /dev/null +++ b/imag-timetrack/src/stop.rs @@ -0,0 +1,23 @@ +// +// 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 +// + +pub fn stop(rt: &Runtime) -> i32 { + unimplemented!() +} + diff --git a/imag-timetrack/src/track.rs b/imag-timetrack/src/track.rs new file mode 100644 index 00000000..c2c36bc0 --- /dev/null +++ b/imag-timetrack/src/track.rs @@ -0,0 +1,25 @@ +// +// 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 libimagrt::runtime::Runtime; + +pub fn track(rt: &Runtime) -> i32 { + unimplemented!() +} + diff --git a/imag-timetrack/src/week.rs b/imag-timetrack/src/week.rs new file mode 100644 index 00000000..f81b6db0 --- /dev/null +++ b/imag-timetrack/src/week.rs @@ -0,0 +1,25 @@ +// +// 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 libimagrt::runtime::Runtime; + +pub fn week(rt: &Runtime) -> i32 { + unimplemented!() +} + diff --git a/imag-timetrack/src/year.rs b/imag-timetrack/src/year.rs new file mode 100644 index 00000000..7f7ddeb8 --- /dev/null +++ b/imag-timetrack/src/year.rs @@ -0,0 +1,25 @@ +// +// 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 libimagrt::runtime::Runtime; + +pub fn year(rt: &Runtime) -> i32 { + unimplemented!() +} +