Add modules for functionality
This commit is contained in:
parent
0955a38ee2
commit
8379c3b5e5
9 changed files with 244 additions and 1 deletions
25
imag-timetrack/src/cont.rs
Normal file
25
imag-timetrack/src/cont.rs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// 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 libimagrt::runtime::Runtime;
|
||||||
|
|
||||||
|
pub fn cont(rt: &Runtime) -> i32 {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
|
25
imag-timetrack/src/day.rs
Normal file
25
imag-timetrack/src/day.rs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// 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 libimagrt::runtime::Runtime;
|
||||||
|
|
||||||
|
pub fn day(rt: &Runtime) -> i32 {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
|
|
@ -17,8 +17,55 @@
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
// 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 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() {
|
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);
|
||||||
}
|
}
|
||||||
|
|
25
imag-timetrack/src/month.rs
Normal file
25
imag-timetrack/src/month.rs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// 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 libimagrt::runtime::Runtime;
|
||||||
|
|
||||||
|
pub fn month(rt: &Runtime) -> i32 {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
|
23
imag-timetrack/src/start.rs
Normal file
23
imag-timetrack/src/start.rs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
//
|
||||||
|
|
||||||
|
pub fn start(rt: &Runtime) -> i32 {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
|
23
imag-timetrack/src/stop.rs
Normal file
23
imag-timetrack/src/stop.rs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
//
|
||||||
|
|
||||||
|
pub fn stop(rt: &Runtime) -> i32 {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
|
25
imag-timetrack/src/track.rs
Normal file
25
imag-timetrack/src/track.rs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// 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 libimagrt::runtime::Runtime;
|
||||||
|
|
||||||
|
pub fn track(rt: &Runtime) -> i32 {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
|
25
imag-timetrack/src/week.rs
Normal file
25
imag-timetrack/src/week.rs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// 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 libimagrt::runtime::Runtime;
|
||||||
|
|
||||||
|
pub fn week(rt: &Runtime) -> i32 {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
|
25
imag-timetrack/src/year.rs
Normal file
25
imag-timetrack/src/year.rs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// 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 libimagrt::runtime::Runtime;
|
||||||
|
|
||||||
|
pub fn year(rt: &Runtime) -> i32 {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue