mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 06:35:56 +02:00
Sort entries in scope
commands; Fix usage of externs (#10039)
# Description * All output of `scope` commands is sorted by the "name" column. (`scope externs` and some other commands had entries in a weird/random order) * The output of `scope externs` does not have extra newlines (that was due to wrong usage creation of known externals)
This commit is contained in:
@ -11,6 +11,7 @@ pub struct KnownExternal {
|
||||
pub name: String,
|
||||
pub signature: Box<Signature>,
|
||||
pub usage: String,
|
||||
pub extra_usage: String,
|
||||
}
|
||||
|
||||
impl Command for KnownExternal {
|
||||
|
@ -215,6 +215,7 @@ pub fn parse_def_predecl(working_set: &mut StateWorkingSet, spans: &[Span]) {
|
||||
let decl = KnownExternal {
|
||||
name,
|
||||
usage: "run external command".into(),
|
||||
extra_usage: "".into(),
|
||||
signature,
|
||||
};
|
||||
|
||||
@ -650,7 +651,8 @@ pub fn parse_extern(
|
||||
} else {
|
||||
let decl = KnownExternal {
|
||||
name: external_name,
|
||||
usage: [usage, extra_usage].join("\n"),
|
||||
usage,
|
||||
extra_usage,
|
||||
signature,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user