feat: Add default docs for aliases, generated from the command they point to (#10825)

This commit is contained in:
Poliorcetics
2023-12-04 19:56:46 +01:00
committed by GitHub
parent c9aa6ba0f3
commit fc06afd051
2 changed files with 30 additions and 1 deletions

View File

@ -155,3 +155,11 @@ fn alias_ordering() {
let actual = nu!(r#"alias bar = echo; def echo [] { 'dummy echo' }; bar 'foo'"#);
assert_eq!(actual.out, "foo");
}
#[test]
fn alias_default_help() {
let actual = nu!("alias teapot = echo 'I am a beautiful teapot'; help teapot");
// There must be at least one line of help
let first_help_line = actual.out.lines().next().unwrap();
assert!(first_help_line.starts_with("Alias for `echo 'I am a beautiful teapot'`"));
}