Rename library functions from "main"
This commit is contained in:
parent
6e6d4b227d
commit
983456997b
5 changed files with 8 additions and 8 deletions
|
@ -62,7 +62,7 @@ fn auth_user(username: String, resource: String) -> Result<(), ()> {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn csv() {
|
||||||
let args: Vec<String> = std::env::args().collect();
|
let args: Vec<String> = std::env::args().collect();
|
||||||
let method = String::from(&args[1]);
|
let method = String::from(&args[1]);
|
||||||
let identifier = String::from(&args[2]);
|
let identifier = String::from(&args[2]);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use gpio_cdev::{Chip, LineRequestFlags};
|
use gpio_cdev::{Chip, LineRequestFlags};
|
||||||
|
|
||||||
pub fn main() {
|
pub fn gpio() {
|
||||||
let mut chip = Chip::new("/dev/gpiochip0").unwrap();
|
let mut chip = Chip::new("/dev/gpiochip0").unwrap();
|
||||||
let handle = chip
|
let handle = chip
|
||||||
.get_line(6)
|
.get_line(6)
|
||||||
|
|
|
@ -30,7 +30,7 @@ async fn on_room_message(event: SyncMessageEvent<MessageEventContent>, room: Roo
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
pub async fn main(username: String, password: String) -> Result<()> {
|
pub async fn matrix(username: String, password: String) -> Result<()> {
|
||||||
let user = UserId::try_from(username)?;
|
let user = UserId::try_from(username)?;
|
||||||
let client = Client::new_from_user_id(user.clone()).await?;
|
let client = Client::new_from_user_id(user.clone()).await?;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ async fn answer(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
pub async fn main(token: String) {
|
pub async fn telegram(token: String) {
|
||||||
teloxide::enable_logging!();
|
teloxide::enable_logging!();
|
||||||
log::info!("Starting labadoor Telegram bot...");
|
log::info!("Starting labadoor Telegram bot...");
|
||||||
let bot = Bot::new(token).auto_send();
|
let bot = Bot::new(token).auto_send();
|
||||||
|
|
|
@ -5,19 +5,19 @@ fn main() {
|
||||||
match &cli.command {
|
match &cli.command {
|
||||||
#[cfg(feature = "telegram")]
|
#[cfg(feature = "telegram")]
|
||||||
cli::Command::Telegram(_) => {
|
cli::Command::Telegram(_) => {
|
||||||
labadoor_telegram::main();
|
labadoor_telegram::telegram();
|
||||||
}
|
}
|
||||||
#[cfg(feature = "matrix")]
|
#[cfg(feature = "matrix")]
|
||||||
cli::Command::Matrix(_) => {
|
cli::Command::Matrix(_) => {
|
||||||
labadoor_matrix::main();
|
labadoor_matrix::matrix();
|
||||||
}
|
}
|
||||||
#[cfg(feature = "csv")]
|
#[cfg(feature = "csv")]
|
||||||
cli::Command::CSV => {
|
cli::Command::CSV => {
|
||||||
labadoor_csv::main();
|
labadoor_csv::csv();
|
||||||
}
|
}
|
||||||
#[cfg(feature = "gpio")]
|
#[cfg(feature = "gpio")]
|
||||||
cli::Command::GPIO => {
|
cli::Command::GPIO => {
|
||||||
labadoor_gpio::main();
|
labadoor_gpio::gpio();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue