mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 12:49:04 +02:00
Make Nu bootstrap itself from main. (#3619)
We've relied on `clap` for building our cli app bootstrapping that figures out the positionals, flags, and other convenient facilities. Nu has been capable of solving this problem for quite some time. Given this and much more reasons (including the build time caused by `clap`) we start here working with our own.
This commit is contained in:
committed by
GitHub
parent
ec96e85d04
commit
7c7e5112ea
@ -153,8 +153,7 @@ impl EvaluationContext {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub(crate) fn get_command(&self, name: &str) -> Option<Command> {
|
||||
pub fn get_command(&self, name: &str) -> Option<Command> {
|
||||
self.scope.get_command(name)
|
||||
}
|
||||
|
||||
@ -162,7 +161,7 @@ impl EvaluationContext {
|
||||
self.scope.has_command(name)
|
||||
}
|
||||
|
||||
pub(crate) fn run_command(
|
||||
pub fn run_command(
|
||||
&self,
|
||||
command: Command,
|
||||
name_tag: Tag,
|
||||
|
@ -265,11 +265,11 @@ pub fn run_script_standalone(
|
||||
redirect_stdin: bool,
|
||||
context: &EvaluationContext,
|
||||
exit_on_error: bool,
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
) -> Result<(), ShellError> {
|
||||
context
|
||||
.shell_manager()
|
||||
.enter_script_mode()
|
||||
.map_err(Box::new)?;
|
||||
.map_err(ShellError::from)?;
|
||||
let line = process_script(&script_text, context, redirect_stdin, 0, false);
|
||||
|
||||
match line {
|
||||
|
Reference in New Issue
Block a user