Collapse some help commands columns into a single column#7052
Collapse some help commands columns into a single column#7052rgwood merged 1 commit intonushell:mainfrom
help commands columns into a single column#7052Conversation
86ed54a to
aa944c0
Compare
| (false, true, false, false) => CommandType::Custom, | ||
| (_, false, true, false) => CommandType::Keyword, | ||
| (false, false, false, true) => CommandType::Plugin, | ||
| _ => CommandType::Other, |
There was a problem hiding this comment.
I discovered via trial and error that Keyword is also a Builtin. If people like this direction, maybe someone who knows the language internals better could take a look at this match statement: is it making any incorrect assumptions about mutual exclusivity and are there things being classified as Other that should not be?
|
Thanks! We agreed in the Discord meeting today that this looks like a solid improvement. Whenever you have time, could you please document this in the breaking changes section for the 0.72 release? nushell/nushell.github.io#666 |
|
Documented this breaking change in the v0.72 blog post. |
|
Plugins are no longer able to be found in help commands since |
|
@fdncred would you be able to print out the value of the 4 booleans in the |
|
Hm, yeah we need to figure out the right place to put wildcards ( nushell/crates/nu-protocol/src/engine/command.rs Lines 87 to 100 in 18d7e64 |
|
I added this fn command_type(&self) -> CommandType {
match (
self.is_builtin(),
self.is_custom_command(),
self.is_parser_keyword(),
self.is_known_external(),
self.is_plugin().is_some(),
) {
(true, false, false, false, false) => CommandType::Builtin,
(true, true, false, false, false) => CommandType::Custom,
(true, false, true, false, false) => CommandType::Keyword,
(false, true, false, true, false) => CommandType::External,
(false, false, false, false, true) => CommandType::Plugin,
_ => {
eprintln!(
"
builtin: {}, custom: {}, keyword: {}, known_external: {}, plugin: {}",
self.is_builtin(),
self.is_custom_command(),
self.is_parser_keyword(),
self.is_known_external(),
self.is_plugin().is_some()
);
CommandType::Other
}
}
} |
|
fixed here #7088 |
If I'm understanding that correctly from [this PR](nushell/nushell#7052) `command_type` should be `plugin` if it comes from a plugin.
If I'm understanding that correctly from [this PR](nushell/nushell#7052) `command_type` should be `plugin` if it comes from a plugin.


This PR collapses the
is_plugin,is_custom,is_keywordboolean columns down to a single column taking values in{plugin, custom, keyword, other}. The motivation is that it makes the table easier to visually digest (and arguably easier to query?).Before
After