diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 523b2d9bc..7143a59bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,6 +58,10 @@ fn main() { .help("The number of currently running jobs") .takes_value(true); + let init_scripts_arg = Arg::with_name("print_full_init") + .long("print-full-init") + .help("Print the main initialization script (as opposed to the init stub)"); + let matches = App::new("starship") .about("The cross-shell prompt for astronauts. ☄🌌️") // pull the version number from Cargo.toml @@ -69,7 +73,8 @@ fn main() { .subcommand( SubCommand::with_name("init") .about("Prints the shell function used to execute starship") - .arg(&shell_arg), + .arg(&shell_arg) + .arg(&init_scripts_arg), ) .subcommand( SubCommand::with_name("prompt") @@ -99,7 +104,11 @@ fn main() { match matches.subcommand() { ("init", Some(sub_m)) => { let shell_name = sub_m.value_of("shell").expect("Shell name missing."); - init::init(shell_name) + if sub_m.is_present("print_full_init") { + init::init_main(shell_name); + } else { + init::init_stub(shell_name); + } } ("prompt", Some(sub_m)) => print::prompt(sub_m.clone()), ("module", Some(sub_m)) => { |