]> git.ipfire.org Git - thirdparty/linux.git/commit
kunit: add bash completion
authorRyota Sakamoto <sakamo.ryota@gmail.com>
Fri, 16 Jan 2026 17:46:34 +0000 (02:46 +0900)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 20 Jan 2026 18:17:52 +0000 (11:17 -0700)
commitdb0c35ca36526f3072affcb573631ccf8c85f827
tree1499467fd38498efcd53c9760fbc362d80ffccc4
parentf126d688193b4dd6d0044c19771469724c03f8f8
kunit: add bash completion

Currently, kunit.py has many subcommands and options, making it difficult
to remember them without checking the help message.

Add --list-cmds and --list-opts to kunit.py to get available commands and
options, use those outputs in kunit-completion.sh to show completion.

This implementation is similar to perf and tools/perf/perf-completion.sh.

Example output:
  $ source tools/testing/kunit/kunit-completion.sh
  $ ./tools/testing/kunit/kunit.py [TAB][TAB]
  build   config  exec    parse   run
  $ ./tools/testing/kunit/kunit.py run --k[TAB][TAB]
  --kconfig_add  --kernel_args  --kunitconfig

Link: https://lore.kernel.org/r/20260117-kunit-completion-v2-1-cabd127d0801@gmail.com
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Ryota Sakamoto <sakamo.ryota@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Documentation/dev-tools/kunit/run_wrapper.rst
tools/testing/kunit/kunit-completion.sh [new file with mode: 0644]
tools/testing/kunit/kunit.py
tools/testing/kunit/kunit_tool_test.py