Skip to content

Conversation

@HelloByeAll
Copy link
Contributor

@HelloByeAll HelloByeAll commented Sep 25, 2023

拉取/合并请求描述:(PR description)

[
新增msh自动补全子选项特性, 关闭旧的pr #7304,重新整理提交

并确认并列出已经在什么情况或板卡上进行了测试。
And confirm in which case or board has been tested. -->

为什么提交这份PR (why to submit this PR)

你的解决方案是什么 (what is your solution)

在什么测试环境下测试通过 (what is the test environment)

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

*/
#define MSH_CMD_EXPORT(command, desc) \
MSH_FUNCTION_EXPORT_CMD(command, command, desc)
/* MSH_CMD_EXPORT(command, desc) or MSH_CMD_EXPORT(command, desc, opt) */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看起来和之前是兼容的是吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完全兼容

case RT_Object_Class_Device: list_device(); break;
#endif /* RT_USING_DEVICE */
#ifdef RT_USING_DFS
case 0x100:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

做个宏定义吧,不应该出现绝对数值的。

int "The number of arguments for a shell command"
default 10

config FINSH_OPTION_COMPLETION_ENABLED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

风格不统一了,用FINSH_USING_OPTION_COMPLETION

}
#endif /* RT_USING_DEVICE */

#ifndef FINSH_OPTION_COMPLETION_ENABLED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面部分代码是否也可以做到统一,而不是完全函数级的条件宏控制

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下面的处理中使用到了MSH_OPT_ID_GET这个宏,参数处理上简单了很多,与之前的方式是不一样的,做不到统一

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把之前的处理方式改掉可以做到统一

#define CMD_OPTIONS_NODE(_id, _name, _des) {.id = _id, .name = #_name, .des = #_des},
#define CMD_OPTIONS_NODE_END {0},};

extern void msh_opt_list_dump(void *options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

头文件中函数声明不需要使用extern

msh_auto_complete(prefix);

#ifdef FINSH_OPTION_COMPLETION_ENABLED
msh_opt_auto_complete(prefix);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也许未来在auto complete方面,可以用链表插件的方式,可以在msh中一级级的挂载多中自动完成

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前考虑过这个, 在这套上面加链表改动很小就能实现,目前暂时用不到,所以只支持了二级

@BernardXiong BernardXiong merged commit 2d630e3 into RT-Thread:master Sep 27, 2023
@mysterywolf
Copy link
Member

mysterywolf commented Nov 26, 2023

此修改造成bsp:simulator VS编译不过,仿真器无法运行。

4be738054e186fef2166c2220bcb2a0

mysterywolf added a commit to mysterywolf/rt-thread that referenced this pull request Nov 26, 2023
mysterywolf added a commit that referenced this pull request Mar 29, 2024
新增加的二级命令使用方式没有清晰的描述
功能实现PR:#8086
补充优化PR:#8251
使用二级命令的例子:#8398
相关issue:#8691
mysterywolf added a commit that referenced this pull request Mar 29, 2024
新增加的二级命令使用方式没有清晰的描述
- 功能实现PR:#8086
- 补充优化PR:#8251
- 使用二级命令的例子:#8398
- 相关issue:#8691
mysterywolf added a commit that referenced this pull request Mar 30, 2024
新增加的二级命令使用方式没有清晰的描述
- 功能实现PR:#8086
- 补充优化PR:#8251
- 使用二级命令的例子:#8398
- 相关issue:#8691
mysterywolf added a commit that referenced this pull request Apr 17, 2024
新增加的二级命令使用方式没有清晰的描述
- 功能实现PR:#8086
- 补充优化PR:#8251
- 使用二级命令的例子:#8398
- 相关issue:#8691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants