nushell/src/main.rs
Andrés N. Robalino 7c7e5112ea
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.
2021-06-15 17:43:25 -05:00

14 lines
282 B
Rust

use nu_cli::App as CliApp;
use nu_errors::ShellError;
fn main() -> Result<(), ShellError> {
let mut argv = vec![String::from("nu")];
argv.extend(positionals());
CliApp::run(&argv)
}
fn positionals() -> Vec<String> {
std::env::args().skip(1).collect::<Vec<_>>()
}