mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 02:06:21 +08:00
Minor comment cleanup of main.rs
This commit is contained in:
parent
e62f32c16b
commit
b315b66cb0
|
@ -367,7 +367,7 @@ fn fish_parse_opt(args: &mut [&wstr], opts: &mut FishCmdOpts) -> usize {
|
||||||
|
|
||||||
const RUSAGE_ARG: char = 1 as char;
|
const RUSAGE_ARG: char = 1 as char;
|
||||||
const PRINT_DEBUG_CATEGORIES_ARG: char = 2 as char;
|
const PRINT_DEBUG_CATEGORIES_ARG: char = 2 as char;
|
||||||
const PROFILE_STARTUP_ARG: char = 4 as char;
|
const PROFILE_STARTUP_ARG: char = 3 as char;
|
||||||
|
|
||||||
const SHORT_OPTS: &wstr = L!("+hPilNnvc:C:p:d:f:D:o:");
|
const SHORT_OPTS: &wstr = L!("+hPilNnvc:C:p:d:f:D:o:");
|
||||||
const LONG_OPTS: &[woption<'static>] = &[
|
const LONG_OPTS: &[woption<'static>] = &[
|
||||||
|
@ -483,7 +483,7 @@ fn fish_parse_opt(args: &mut [&wstr], opts: &mut FishCmdOpts) -> usize {
|
||||||
);
|
);
|
||||||
std::process::exit(1)
|
std::process::exit(1)
|
||||||
}
|
}
|
||||||
_ => panic!("unexpected retval from wgetoptr_t"),
|
_ => panic!("unexpected retval from wgetopter_t"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let optind = w.woptind;
|
let optind = w.woptind;
|
||||||
|
@ -531,9 +531,9 @@ fn main() -> i32 {
|
||||||
let mut res = 1;
|
let mut res = 1;
|
||||||
let mut my_optind;
|
let mut my_optind;
|
||||||
|
|
||||||
|
signal_unblock_all();
|
||||||
topic_monitor::topic_monitor_init();
|
topic_monitor::topic_monitor_init();
|
||||||
threads::init();
|
threads::init();
|
||||||
signal_unblock_all();
|
|
||||||
|
|
||||||
{
|
{
|
||||||
let s = CString::new("").unwrap();
|
let s = CString::new("").unwrap();
|
||||||
|
@ -546,6 +546,8 @@ fn main() -> i32 {
|
||||||
args.push("fish".into());
|
args.push("fish".into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable debug categories set in FISH_DEBUG.
|
||||||
|
// This is in *addition* to the ones given via --debug.
|
||||||
if let Some(debug_categories) = env::var_os("FISH_DEBUG") {
|
if let Some(debug_categories) = env::var_os("FISH_DEBUG") {
|
||||||
let s = str2wcstring(debug_categories.as_bytes());
|
let s = str2wcstring(debug_categories.as_bytes());
|
||||||
activate_flog_categories_by_pattern(&s);
|
activate_flog_categories_by_pattern(&s);
|
||||||
|
@ -612,6 +614,7 @@ fn main() -> i32 {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No-exec is prohibited when in interactive mode.
|
||||||
if opts.is_interactive_session && opts.no_exec {
|
if opts.is_interactive_session && opts.no_exec {
|
||||||
FLOG!(
|
FLOG!(
|
||||||
warning,
|
warning,
|
||||||
|
@ -648,7 +651,11 @@ fn main() -> i32 {
|
||||||
paths = Some(determine_config_directory_paths(OsString::from_vec(
|
paths = Some(determine_config_directory_paths(OsString::from_vec(
|
||||||
wcs2string(args[0]),
|
wcs2string(args[0]),
|
||||||
)));
|
)));
|
||||||
env_init(paths.as_ref(), !opts.no_config, opts.no_config);
|
env_init(
|
||||||
|
paths.as_ref(),
|
||||||
|
/* do uvars */ !opts.no_config,
|
||||||
|
/* default paths */ opts.no_config,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set features early in case other initialization depends on them.
|
// Set features early in case other initialization depends on them.
|
||||||
|
@ -824,12 +831,6 @@ fn main() -> i32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/fish-shell/fish-shell/issues/367
|
// https://github.com/fish-shell/fish-shell/issues/367
|
||||||
//
|
|
||||||
// With them the Seed of Wisdom did I sow,
|
|
||||||
// And with my own hand labour'd it to grow:
|
|
||||||
// And this was all the Harvest that I reap'd---
|
|
||||||
// "I came like Water, and like Wind I go."
|
|
||||||
|
|
||||||
fn escape_single_quoted_hack_hack_hack_hack(s: &wstr) -> OsString {
|
fn escape_single_quoted_hack_hack_hack_hack(s: &wstr) -> OsString {
|
||||||
let mut result = OsString::with_capacity(s.len() + 2);
|
let mut result = OsString::with_capacity(s.len() + 2);
|
||||||
result.push("\'");
|
result.push("\'");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user