35 lines
673 B
Rust
35 lines
673 B
Rust
use std::{default, fs};
|
|
|
|
use clap::{Parser, Subcommand};
|
|
use commands::current_journey::get_current_journey;
|
|
use reqwest::{
|
|
header::{self, HeaderMap},
|
|
ClientBuilder,
|
|
};
|
|
use traewelling::model::{Container, Status};
|
|
|
|
mod commands;
|
|
mod traewelling;
|
|
|
|
#[derive(Parser)]
|
|
struct Cli {
|
|
#[command(subcommand)]
|
|
subcommand: Subcommands,
|
|
}
|
|
|
|
#[derive(Subcommand, Clone)]
|
|
enum Subcommands {
|
|
/// Watch for a current journey and give out json info about it
|
|
Current,
|
|
}
|
|
|
|
#[tokio::main]
|
|
async fn main() -> anyhow::Result<()> {
|
|
let args = Cli::parse();
|
|
|
|
match args.subcommand {
|
|
Subcommands::Current => get_current_journey().await?,
|
|
};
|
|
|
|
Ok(())
|
|
}
|