WIP
This commit is contained in:
parent
33592de8f3
commit
fce417214d
3 changed files with 6 additions and 4 deletions
|
@ -446,7 +446,7 @@ pub(super) async fn run() -> Result<(), Error> {
|
|||
.as_bytes(),
|
||||
)
|
||||
.map_err(WriteTomlConfigError::ServerWrite)?;
|
||||
cprintln!("<g!><bold>config/server.toml</></> has been created!");
|
||||
cprintln!("<bold>config/server.toml</> has been created!");
|
||||
|
||||
let mut client_toml =
|
||||
fs::File::create("config/client.toml").map_err(WriteTomlConfigError::ClientWrite)?;
|
||||
|
@ -457,7 +457,7 @@ pub(super) async fn run() -> Result<(), Error> {
|
|||
.as_bytes(),
|
||||
)
|
||||
.map_err(WriteTomlConfigError::ClientWrite)?;
|
||||
cprintln!("<g><bold>config/client.toml</></> has been created!");
|
||||
cprintln!("<bold>config/client.toml</> has been created!");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// does not take care of it.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use validator::{Validate, ValidationErrors};
|
||||
use validator::Validate;
|
||||
|
||||
#[derive(Deserialize, Serialize, Validate, Debug)]
|
||||
pub struct Config {
|
||||
|
@ -81,6 +81,7 @@ pub struct CacheServer {
|
|||
pub port: u16,
|
||||
pub user: Option<String>,
|
||||
pub password: Option<String>,
|
||||
#[validate(range(min = 0, max = 15))]
|
||||
pub index: Option<u8>,
|
||||
pub prefix: Option<String>,
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ mod command;
|
|||
mod config;
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
use color_print::cprintln;
|
||||
|
||||
/// latest Firefish version as of this fishctl release
|
||||
const FIREFISH_VERSION: &str = "20240613";
|
||||
|
@ -37,7 +38,7 @@ async fn main() {
|
|||
let res = run().await;
|
||||
|
||||
if let Err(err) = res {
|
||||
println!("An error occurred!");
|
||||
cprintln!("<r!><bold>Error:</></>");
|
||||
println!(" raw: {:?}", err);
|
||||
println!(" message: {}", err);
|
||||
|
||||
|
|
Loading…
Reference in a new issue