Skip to content

Command help and tab completion for File Apps#10

Open
jnippula wants to merge 2 commits into
masterfrom
file_app_help_and_cmd_completion
Open

Command help and tab completion for File Apps#10
jnippula wants to merge 2 commits into
masterfrom
file_app_help_and_cmd_completion

Conversation

@jnippula

@jnippula jnippula commented Apr 9, 2026

Copy link
Copy Markdown

Summary

There is no command help or command tab completion available
for file apps. This patch adds support for those, similar to what is
implemented for buildin apps.

Impact

Static completion cache is allocated when tab completion is used
first time. This cache remains in memory until system reboots/shutdown.

Testing

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds NSH help output and readline tab-completion support for “file apps” (executables found via PATH) to match existing built-in app ergonomics.

Changes:

  • Refactors built-in app help output to use a shared help_namelist() formatter.
  • Adds PATH directory scanning to collect file app names for help and for readline completion.
  • Introduces a static, lazily-initialized completion cache for file apps and extends nsh_extmatch_getname() to resolve those entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nshlib/nsh_command.c
Comment thread nshlib/nsh_command.c
Comment thread nshlib/nsh_command.c
@jnippula jnippula force-pushed the file_app_help_and_cmd_completion branch 4 times, most recently from 255c747 to 24f860b Compare April 9, 2026 12:39
@jnippula jnippula requested a review from Copilot April 9, 2026 12:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nshlib/nsh_command.c Outdated
Comment thread nshlib/nsh_command.c
Comment thread nshlib/nsh_command.c
Signed-off-by: Jari Nippula <jari.nippula@tii.ae>
@jnippula jnippula force-pushed the file_app_help_and_cmd_completion branch from 24f860b to 483984a Compare April 10, 2026 07:07
Tab completion for file apps uses static cache populted
once during first usage. If any file applications are
removed or added on runtime, the cache is not reflected
accordingly until nsh shell is restarted.

Signed-off-by: Jari Nippula <jari.nippula@tii.ae>
@jnippula jnippula force-pushed the file_app_help_and_cmd_completion branch from 483984a to 2c4be79 Compare April 10, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants