mirror of
https://github.com/nushell/nushell.git
synced 2025-01-12 09:18:56 +01:00
7c7e5112ea
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.
14 lines
282 B
Rust
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<_>>()
|
|
}
|