mirror of
https://github.com/nushell/nushell.git
synced 2025-06-20 09:58:15 +02:00
adds examples
This commit is contained in:
parent
6fe5851176
commit
f5719513d1
@ -134,6 +134,7 @@ impl Command for Input {
|
|||||||
left_prompt: prompt_str.unwrap_or("".to_string()),
|
left_prompt: prompt_str.unwrap_or("".to_string()),
|
||||||
right_prompt: "".to_string(),
|
right_prompt: "".to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut line_editor = Reedline::create();
|
let mut line_editor = Reedline::create();
|
||||||
line_editor = line_editor.with_ansi_colors(false);
|
line_editor = line_editor.with_ansi_colors(false);
|
||||||
line_editor = match history {
|
line_editor = match history {
|
||||||
@ -184,6 +185,16 @@ impl Command for Input {
|
|||||||
example: "let user_input = (input --default 10)",
|
example: "let user_input = (input --default 10)",
|
||||||
result: None,
|
result: None,
|
||||||
},
|
},
|
||||||
|
Example {
|
||||||
|
description: "Get input from the user with history, and assign to a variable",
|
||||||
|
example: "let user_input = (input --history [past,command,entries])",
|
||||||
|
result: None,
|
||||||
|
},
|
||||||
|
Example {
|
||||||
|
description: "Get input from the user with history backed by a file, and assign to a variable",
|
||||||
|
example: "let user_input = (input --history ./history.txt)",
|
||||||
|
result: None,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user