mirror of
https://github.com/vinc/moros.git
synced 2024-06-15 05:36:38 +00:00
* Link host 8080 port to qemu 80 * Add root dir * Add support for images * Add Response struct * Refactor response buffer creation * Add index file support * Copy www dir * Update trailing slash rule * Add command line arguments * Remove strftime function * Add read only mode * Implement Display * Add colored output * Add Request struct * Add common date time format * Add time::now_utc * Add connexions pool * Reduce wait time * Add install --yes * Fix typo * Add more mime types
19 lines
505 B
Rust
19 lines
505 B
Rust
use crate::api;
|
|
use crate::api::clock::DATE_TIME_ZONE;
|
|
use crate::api::process::ExitCode;
|
|
use time::validate_format_string;
|
|
|
|
pub fn main(args: &[&str]) -> Result<(), ExitCode> {
|
|
let format = if args.len() > 1 { args[1] } else { DATE_TIME_ZONE };
|
|
match validate_format_string(format) {
|
|
Ok(()) => {
|
|
println!("{}", api::time::now().format(format));
|
|
Ok(())
|
|
}
|
|
Err(e) => {
|
|
error!("{}", e);
|
|
Err(ExitCode::Failure)
|
|
}
|
|
}
|
|
}
|