Repository: lapce/lapce
File: lapce-ui/src/app.rs (Rust)

Code before:

use crate::logging::override_log_levels;
use crate::window::LapceWindow;

#[cfg(target_os = "linux")]
const LOGO_PNG: &[u8] = include_bytes!("../../extra/images/logo.png");
#[cfg(target_os = "windows")]
const LOGO_ICO: &[u8] = include_bytes!("../../extra/windows/lapce.ico");

pub fn build_window(data: &mut LapceWindowData) -> impl Widget<LapceData> {
    LapceWindow::new(data).lens(LapceWindowLens(data.window_id))
}

pub fn launch() {
    let mut args = std::env::args();
    let mut path = None;
    if args.len() > 1 {
        args.next();
        for arg in args {
            match arg.as_str() {
                "-v" | "--version" => {
                    println!("lapce v{VERSION}");
                    return;
                }
                "-h" | "--help" => {
                    println!("lapce [-h|-help] [-v|--version] [PATH]");
                    return;
                }
                v => {
                    if v.starts_with('-') {
                        eprintln!("lapce: unrecognized option: {v}");
                        std::process::exit(1)
                    } else {
                        path = Some(v.to_string())
                    }
                }
            }
        }
    }

    let mut log_dispatch = fern::Dispatch::new()
        .format(|out, message, record| {
            out.finish(format_args!(
                "{}[{}][{}] {}",
                chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
                record.target(),
                record.level(),
                message
            ))
        })
        .level(if cfg!(debug_assertions) {

Review comment (suggestion):
oops, typo
```suggestion
                    println!("lapce [-h|--help] [-v|--version] [PATH]");
```

Code after:

use crate::logging::override_log_levels;
use crate::window::LapceWindow;

#[cfg(target_os = "linux")]
const LOGO_PNG: &[u8] = include_bytes!("../../extra/images/logo.png");
#[cfg(target_os = "windows")]
const LOGO_ICO: &[u8] = include_bytes!("../../extra/windows/lapce.ico");

pub fn build_window(data: &mut LapceWindowData) -> impl Widget<LapceData> {
    LapceWindow::new(data).lens(LapceWindowLens(data.window_id))
}

pub fn launch() {
    let mut args = std::env::args();
    let mut path = None;
    if args.len() > 1 {
        args.next();
        for arg in args {
            match arg.as_str() {
                "-v" | "--version" => {
                    println!("lapce v{VERSION}");
                    return;
                }
                "-h" | "--help" => {
                    println!("lapce [-h|--help] [-v|--version] [PATH]");
                    return;
                }
                v => {
                    if v.starts_with('-') {
                        eprintln!("lapce: unrecognized option: {v}");
                        std::process::exit(1)
                    } else {
                        path = Some(v.to_string())
                    }
                }
            }
        }
    }

    let mut log_dispatch = fern::Dispatch::new()
        .format(|out, message, record| {
            out.finish(format_args!(
                "{}[{}][{}] {}",
                chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
                record.target(),
                record.level(),
                message
            ))
        })
        .level(if cfg!(debug_assertions) {