MCPcopy Index your code
hub / github.com/encounter/objdiff / main

Function main

objdiff-gui/src/main.rs:106–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104const APP_NAME: &str = "objdiff";
105
106fn main() -> ExitCode {
107 let args: TopLevel = argp_version::from_env();
108 let builder = tracing_subscriber::fmt();
109 if let Some(level) = args.log_level {
110 builder
111 .with_max_level(match level {
112 LogLevel::Error => LevelFilter::ERROR,
113 LogLevel::Warn => LevelFilter::WARN,
114 LogLevel::Info => LevelFilter::INFO,
115 LogLevel::Debug => LevelFilter::DEBUG,
116 LogLevel::Trace => LevelFilter::TRACE,
117 })
118 .init();
119 } else {
120 builder
121 .with_env_filter(
122 EnvFilter::builder()
123 // Default to info level
124 .with_default_directive(LevelFilter::INFO.into())
125 .from_env_lossy()
126 // This module is noisy at info level
127 .add_directive("wgpu_core::device::resource=warn".parse().unwrap()),
128 )
129 .init();
130 }
131
132 // Because localtime_r is unsound in multithreaded apps,
133 // we must call this before initializing eframe.
134 // https://github.com/time-rs/time/issues/293
135 let utc_offset = UtcOffset::current_local_offset().unwrap_or(UtcOffset::UTC);
136
137 // Resolve project directory if provided
138 let project_dir = if let Some(path) = args.project_dir {
139 match path.canonicalize() {
140 Ok(path) => {
141 // Ensure the path is a directory
142 if path.is_dir() {
143 match check_path_buf(path) {
144 Ok(path) => Some(path),
145 Err(e) => {
146 log::error!("Failed to convert project directory to UTF-8 path: {}", e);
147 None
148 }
149 }
150 } else {
151 log::error!("Project directory is not a directory: {}", path.display());
152 None
153 }
154 }
155 Err(e) => {
156 log::error!("Failed to canonicalize project directory: {}", e);
157 None
158 }
159 }
160 } else {
161 None
162 };
163

Callers

nothing calls this directly

Calls 8

check_path_bufFunction · 0.85
load_iconFunction · 0.85
load_graphics_configFunction · 0.85
run_eframeFunction · 0.85
initMethod · 0.80
is_supportedMethod · 0.80
from_envFunction · 0.70
parseMethod · 0.45

Tested by

no test coverage detected