Skip to content

Commit

Permalink
fix bash completion for Fortress (#333)
Browse files Browse the repository at this point in the history
Signed-off-by: Jenn Nguyen <jenn@openrobotics.org>
  • Loading branch information
jennuine committed Jul 20, 2022
1 parent c3ac30a commit c0c54bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ foreach(test ${test_list})
# multi-configuration generators, like Visual Studio.
target_compile_definitions(${test} PRIVATE
"DETAIL_IGN_TRANSPORT_TEST_DIR=\"$<TARGET_FILE_DIR:${test}>\""
"IGN_TEST_LIBRARY_PATH=\"$<TARGET_FILE_DIR:${PROJECT_LIBRARY_TARGET_NAME}>\""
"PROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\"")
"IGN_TEST_LIBRARY_PATH=\"$<TARGET_FILE_DIR:${PROJECT_LIBRARY_TARGET_NAME}>\"")
endforeach()

if(MSVC)
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ foreach(test ${test_list})
# multi-configuration generators, like Visual Studio.
target_compile_definitions(${test} PRIVATE
"DETAIL_IGN_TRANSPORT_TEST_DIR=\"$<TARGET_FILE_DIR:${test}>\""
"IGN_TEST_LIBRARY_PATH=\"$<TARGET_FILE_DIR:${PROJECT_LIBRARY_TARGET_NAME}>\"")
"IGN_TEST_LIBRARY_PATH=\"$<TARGET_FILE_DIR:${PROJECT_LIBRARY_TARGET_NAME}>\""
"PROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\"")

endforeach()

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/ign_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ TEST(ignTest, TopicEchoNum)
TEST(ignTest, ServiceHelpVsCompletionFlags)
{
// Flags in help message
std::string helpOutput = custom_exec_str("ign service --help" + g_ignVersion);
std::string helpOutput = custom_exec_str("ign service --help");

// Call the output function in the bash completion script
std::filesystem::path scriptPath = PROJECT_SOURCE_DIR;
Expand Down Expand Up @@ -499,7 +499,7 @@ TEST(ignTest, ServiceHelpVsCompletionFlags)
TEST(ignTest, TopicHelpVsCompletionFlags)
{
// Flags in help message
std::string helpOutput = custom_exec_str("ign topic --help" + g_ignVersion);
std::string helpOutput = custom_exec_str("ign topic --help");

// Call the output function in the bash completion script
std::filesystem::path scriptPath = PROJECT_SOURCE_DIR;
Expand Down
11 changes: 3 additions & 8 deletions src/cmd/transport.bash_completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# This is a per-library function definition, used in conjunction with the
# top-level entry point in ign-tools.

# TODO: In Fortress+, remove --force-version and --versions. Add --help-all.
# Update ../ign_TEST.cc accordingly.
GZ_SERVICE_COMPLETION_LIST="
-h --help
-v --version
Expand All @@ -32,12 +30,9 @@ GZ_SERVICE_COMPLETION_LIST="
-l --list
-i --info
-r --req
--force-version
--versions
--help-all
"

# TODO: In Fortress+, remove --force-version and --versions. Add
# `-v --version` and --json-output. Update ../ign_TEST.cc accordingly.
GZ_TOPIC_COMPLETION_LIST="
-h --help
-v --version
Expand All @@ -49,8 +44,8 @@ GZ_TOPIC_COMPLETION_LIST="
-i --info
-e --echo
-p --pub
--force-version
--versions
-v --version
--json-output
"

function _gz_service
Expand Down

0 comments on commit c0c54bb

Please sign in to comment.