1
0
Fork 0

Use returning main and import grouping

This commit is contained in:
Malte Brandy 2018-06-09 14:01:01 +02:00
parent bbe76c6846
commit a64d498d5b
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
3 changed files with 29 additions and 17 deletions

View file

@ -1,14 +1,15 @@
extern crate rust_scripts;
extern crate task_hookrs;
#[macro_use]
extern crate error_chain;
use std::rc::Rc;
use rust_scripts::hotkeys::{run, run_cmd, term, menu, main_loop, Next};
use rust_scripts::kassandra::{kassandra, change_state, new_tasks};
use rust_scripts::error::Result;
use rust_scripts::{
hotkeys::{run, run_cmd, term, menu, main_loop, Next},
kassandra::{kassandra, change_state, new_tasks},
error::Result
};
quick_main!(|| -> Result<()> {
fn main() -> Result<()> {
let w17menu = {
let summer = term("Summer", "ssh summer@door.w17.io");
let lock = term("Lock", "ssh close@door.w17.io");
@ -173,4 +174,4 @@ quick_main!(|| -> Result<()> {
],
).1;
main_loop(startmenu)
});
}

View file

@ -1,7 +1,10 @@
extern crate rust_scripts;
#[macro_use]
extern crate error_chain;
use rust_scripts::kassandra::kassandra;
use rust_scripts::{
error::Result,
kassandra::kassandra
};
quick_main!(kassandra);
fn main() -> Result<()> {
kassandra()
}

View file

@ -1,10 +1,18 @@
use std::rc::Rc;
use dialog::DialogProvider;
use dialog::errors::{Error, ErrorKind as EK};
use dialog::rofi::RofiDialogProvider;
use std::process::Command as StdCommand;
use std::os::unix::process::CommandExt;
use std::env::var;
use dialog::{
DialogProvider,
errors::{
Error,
ErrorKind as EK},
rofi::RofiDialogProvider
};
use std::{
process::Command as StdCommand,
os::unix::process::CommandExt,
env::var,
rc::Rc
};
use error::{Result, ResultExt};
use hotkeys::Next::*;