From 30da9d364058e02092389bf5a628cf42cfe7b0c0 Mon Sep 17 00:00:00 2001 From: Mabel Zhang Date: Tue, 14 Jun 2022 19:34:40 -0400 Subject: [PATCH 1/3] Bash completion for flags (#312) Signed-off-by: Mabel Zhang Signed-off-by: Louise Poubel Co-authored-by: Louise Poubel --- CMakeLists.txt | 7 +- log/test/integration/CMakeLists.txt | 4 +- src/CMakeLists.txt | 4 +- src/cmd/CMakeLists.txt | 13 ++++ src/cmd/transport.bash_completion.sh | 100 +++++++++++++++++++++++++++ src/ign_TEST.cc | 92 ++++++++++++++++++++---- test/test_config.h.in | 2 +- 7 files changed, 203 insertions(+), 19 deletions(-) create mode 100644 src/cmd/transport.bash_completion.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index aa5d35ea7..07ed32541 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,8 +89,11 @@ else () endif() #-------------------------------------- -# Find ignition-tools -ign_find_package(ignition-tools QUIET) +# Find if command is available. This is used to enable tests. +# Note that CLI files are installed regardless of whether the dependency is +# available during build time +find_program(HAVE_IGN_TOOLS ign) +set (IGN_TOOLS_VER 1) #-------------------------------------- # Find SQLite3 diff --git a/log/test/integration/CMakeLists.txt b/log/test/integration/CMakeLists.txt index 7732e81c6..069ff4cb0 100644 --- a/log/test/integration/CMakeLists.txt +++ b/log/test/integration/CMakeLists.txt @@ -64,8 +64,8 @@ foreach(source_file ${aux}) PRIVATE IGN_TRANSPORT_LOG_BUILD_PATH="$") endforeach() -# ign log CLI test -if (IGNITION-TOOLS_BINARY_DIRS) +# CLI test +if (HAVE_IGN_TOOLS) set(IGN_CONFIG_PATH "${CMAKE_BINARY_DIR}/log/test/lib/ruby/ignition") add_test(ign_log_record_no_overwrite diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f9f50c26f..ee8fcad15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,8 +50,8 @@ foreach(test ${test_list}) # multi-configuration generators, like Visual Studio. target_compile_definitions(${test} PRIVATE "DETAIL_IGN_TRANSPORT_TEST_DIR=\"$\"" - "IGN_TEST_LIBRARY_PATH=\"$\"") - + "IGN_TEST_LIBRARY_PATH=\"$\"" + "PROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\"") endforeach() if(MSVC) diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index 643bb0d42..8579a1590 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -42,3 +42,16 @@ file(GENERATE # Install the ruby command line library in an unversioned location. install(FILES ${cmd_script_generated} DESTINATION lib/ruby/ignition) + +#=============================================================================== +# Bash completion + +# Tack version onto and install the bash completion script +configure_file( + "transport.bash_completion.sh" + "${CMAKE_CURRENT_BINARY_DIR}/transport${PROJECT_VERSION_MAJOR}.bash_completion.sh" @ONLY) +install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/transport${PROJECT_VERSION_MAJOR}.bash_completion.sh + DESTINATION + ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gz/gz${IGN_TOOLS_VER}.completion.d) diff --git a/src/cmd/transport.bash_completion.sh b/src/cmd/transport.bash_completion.sh new file mode 100644 index 000000000..80c7282cd --- /dev/null +++ b/src/cmd/transport.bash_completion.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2022 Open Source Robotics Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# bash tab-completion + +# 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 + -s --service + --reqtype + --reptype + --timeout + -l --list + -i --info + -r --req + --force-version + --versions +" + +# 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 + -t --topic + -m --msgtype + -d --duration + -n --num + -l --list + -i --info + -e --echo + -p --pub + --force-version + --versions +" + +function _gz_service +{ + if [[ ${COMP_WORDS[COMP_CWORD]} == -* ]]; then + # Specify options (-*) word list for this subcommand + COMPREPLY=($(compgen -W "$GZ_SERVICE_COMPLETION_LIST" \ + -- "${COMP_WORDS[COMP_CWORD]}" )) + return + else + # Just use bash default auto-complete, because we never have two + # subcommands in the same line. If that is ever needed, change here to + # detect subsequent subcommands + COMPREPLY=($(compgen -o default -- "${COMP_WORDS[COMP_CWORD]}")) + return + fi +} + +function _gz_service_flags +{ + for word in $GZ_SERVICE_COMPLETION_LIST; do + echo "$word" + done +} + +function _gz_topic +{ + if [[ ${COMP_WORDS[COMP_CWORD]} == -* ]]; then + # Specify options (-*) word list for this subcommand + COMPREPLY=($(compgen -W "$GZ_TOPIC_COMPLETION_LIST" \ + -- "${COMP_WORDS[COMP_CWORD]}" )) + return + else + # Just use bash default auto-complete, because we never have two + # subcommands in the same line. If that is ever needed, change here to + # detect subsequent subcommands + COMPREPLY=($(compgen -o default -- "${COMP_WORDS[COMP_CWORD]}")) + return + fi +} + +function _gz_topic_flags +{ + for word in $GZ_TOPIC_COMPLETION_LIST; do + echo "$word" + done +} diff --git a/src/ign_TEST.cc b/src/ign_TEST.cc index f4ba5bf27..4e116efb7 100644 --- a/src/ign_TEST.cc +++ b/src/ign_TEST.cc @@ -15,6 +15,8 @@ * */ +#include +#include #include #include #include @@ -86,7 +88,7 @@ TEST(ignTest, IGN_UTILS_TEST_DISABLED_ON_MAC(TopicList)) g_partition.c_str()); // Check the 'ign topic -l' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); unsigned int retries = 0u; bool topicFound = false; @@ -117,7 +119,7 @@ TEST(ignTest, TopicInfo) g_partition.c_str()); // Check the 'ign topic -i' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); unsigned int retries = 0u; bool infoFound = false; @@ -153,7 +155,7 @@ TEST(ignTest, ServiceList) g_partition.c_str()); // Check the 'ign service -l' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); unsigned int retries = 0u; bool serviceFound = false; @@ -184,7 +186,7 @@ TEST(ignTest, ServiceInfo) g_partition.c_str()); // Check the 'ign service -i' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); unsigned int retries = 0u; bool infoFound = false; @@ -220,7 +222,7 @@ TEST(ignTest, TopicListSameProc) EXPECT_TRUE(pub.Publish(msg)); // Check the 'ign topic -l' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); unsigned int retries = 0u; bool topicFound = false; @@ -251,7 +253,7 @@ TEST(ignTest, TopicInfoSameProc) EXPECT_TRUE(pub.Publish(msg)); // Check the 'ign topic -i' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); unsigned int retries = 0u; bool infoFound = false; @@ -276,7 +278,7 @@ TEST(ignTest, ServiceListSameProc) EXPECT_TRUE(node.Advertise("/foo", srvEcho)); // Check the 'ign service -l' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); unsigned int retries = 0u; bool serviceFound = false; @@ -299,7 +301,7 @@ TEST(ignTest, ServiceInfoSameProc) EXPECT_TRUE(node.Advertise("/foo", srvEcho)); // Check the 'ign service -i' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); unsigned int retries = 0u; bool infoFound = false; @@ -326,7 +328,7 @@ TEST(ignTest, TopicPublish) EXPECT_TRUE(node.Subscribe("/bar", topicCB)); // Check the 'ign topic -p' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); std::string output = custom_exec_str(ign + " topic -t /bar -m ign_msgs.StringMsg -p 'data:\"good_value\"' " + g_ignVersion); @@ -366,7 +368,7 @@ TEST(ignTest, ServiceRequest) msg.set_data(10); // Check the 'ign service -r' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); std::string output = custom_exec_str(ign + " service -s " + service + " --reqtype ign_msgs.Int32 " + "--reptype ign_msgs.Int32 --timeout 1000 " + @@ -388,7 +390,7 @@ TEST(ignTest, TopicEcho) g_partition.c_str()); // Check the 'ign topic -e' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); std::string output = custom_exec_str( ign + " topic -e -t /foo -d 1.5 " + g_ignVersion); @@ -414,7 +416,7 @@ TEST(ignTest, TopicEchoNum) g_partition.c_str()); // Check the 'ign topic -e -n' command. - std::string ign = std::string(IGN_PATH) + "/ign"; + std::string ign = std::string(IGN_PATH); std::string output = custom_exec_str( ign + " topic -e -t /foo -n 2 " + g_ignVersion); @@ -443,6 +445,72 @@ TEST(ignTest, TopicEchoNum) testing::waitAndCleanupFork(pi); } +////////////////////////////////////////////////// +/// \brief Check 'ign service --help' message and bash completion script for +/// consistent flags +TEST(ignTest, ServiceHelpVsCompletionFlags) +{ + // Flags in help message + std::string helpOutput = custom_exec_str("ign service --help" + g_ignVersion); + + // Call the output function in the bash completion script + std::filesystem::path scriptPath = PROJECT_SOURCE_DIR; + scriptPath = scriptPath / "src" / "cmd" / "transport.bash_completion.sh"; + + // Equivalent to: + // sh -c "bash -c \". /path/to/transport.bash_completion.sh; + // _gz_service_flags\"" + std::string cmd = "bash -c \". " + scriptPath.string() + + "; _gz_service_flags\""; + std::string scriptOutput = custom_exec_str(cmd); + + // Tokenize script output + std::istringstream iss(scriptOutput); + std::vector flags((std::istream_iterator(iss)), + std::istream_iterator()); + + EXPECT_GT(flags.size(), 0u); + + // Match each flag in script output with help message + for (const auto &flag : flags) + { + EXPECT_NE(std::string::npos, helpOutput.find(flag)) << helpOutput; + } +} + +////////////////////////////////////////////////// +/// \brief Check 'ign topic --help' message and bash completion script for +/// consistent flags +TEST(ignTest, TopicHelpVsCompletionFlags) +{ + // Flags in help message + std::string helpOutput = custom_exec_str("ign topic --help" + g_ignVersion); + + // Call the output function in the bash completion script + std::filesystem::path scriptPath = PROJECT_SOURCE_DIR; + scriptPath = scriptPath / "src" / "cmd" / "transport.bash_completion.sh"; + + // Equivalent to: + // sh -c "bash -c \". /path/to/transport.bash_completion.sh; + // _gz_topic_flags\"" + std::string cmd = "bash -c \". " + scriptPath.string() + + "; _gz_topic_flags\""; + std::string scriptOutput = custom_exec_str(cmd); + + // Tokenize script output + std::istringstream iss(scriptOutput); + std::vector flags((std::istream_iterator(iss)), + std::istream_iterator()); + + EXPECT_GT(flags.size(), 0u); + + // Match each flag in script output with help message + for (const auto &flag : flags) + { + EXPECT_NE(std::string::npos, helpOutput.find(flag)) << helpOutput; + } +} + ///////////////////////////////////////////////// /// Main int main(int argc, char **argv) diff --git a/test/test_config.h.in b/test/test_config.h.in index a62a68a0f..f64e973ff 100644 --- a/test/test_config.h.in +++ b/test/test_config.h.in @@ -18,7 +18,7 @@ #ifndef IGNITION_TRANSPORT_TEST_CONFIG_HH_ #define IGNITION_TRANSPORT_TEST_CONFIG_HH_ -#define IGN_PATH "@IGNITION-TOOLS_BINARY_DIRS@" +#define IGN_PATH "@HAVE_IGN_TOOLS@" #define IGN_CONFIG_PATH "@CMAKE_BINARY_DIR@/test/conf" #define IGN_VERSION_FULL "@PROJECT_VERSION_FULL@" From 0be3a49c822fbb75cc9521966a53413b13668f79 Mon Sep 17 00:00:00 2001 From: Jenn Nguyen Date: Mon, 18 Jul 2022 17:20:05 -0700 Subject: [PATCH 2/3] Ignition -> Gazebo (#330) Signed-off-by: Jenn Nguyen --- README.md | 56 +++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index c126e96f5..260cb6d79 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# Ignition Transport +# Gazebo Transport **Maintainer:** caguero AT openrobotics DOT org -[![GitHub open issues](https://img.shields.io/github/issues-raw/ignitionrobotics/ign-transport.svg)](https://github.com/ignitionrobotics/ign-transport/issues) -[![GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/ignitionrobotics/ign-transport.svg)](https://github.com/ignitionrobotics/ign-transport/pulls) +[![GitHub open issues](https://img.shields.io/github/issues-raw/gazebosim/gz-transport.svg)](https://github.com/gazebosim/gz-transport/issues) +[![GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/gazebosim/gz-transport.svg)](https://github.com/gazebosim/gz-transport/pulls) [![Discourse topics](https://img.shields.io/discourse/https/community.gazebosim.org/topics.svg)](https://community.gazebosim.org) [![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://www.apache.org/licenses/LICENSE-2.0) Build | Status -- | -- -Test coverage | [![codecov](https://codecov.io/gh/ignitionrobotics/ign-transport/branch/ign-transport8/graph/badge.svg)](https://codecov.io/gh/ignitionrobotics/ign-transport) -Ubuntu Bionic | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_transport-ci-ign-transport8-bionic-amd64)](https://build.osrfoundation.org/job/ignition_transport-ci-ign-transport8-bionic-amd64) +Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-transport/branch/ign-transport8/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-transport/branch/ign-transport8) +Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_transport-ci-ign-transport8-focal-amd64)](https://build.osrfoundation.org/job/ignition_transport-ci-ign-transport8-focal-amd64) Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_transport-ci-ign-transport8-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_transport-ci-ign-transport8-homebrew-amd64) -Windows | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_transport-ci-ign-transport8-windows7-amd64)](https://build.osrfoundation.org/job/ignition_transport-ci-ign-transport8-windows7-amd64) +Windows | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ign_transport-ign-8-win)](https://build.osrfoundation.org/job/ign_transport-ign-8-win) -Ignition Transport, a component of [Ignition Robotics](https://ignitionrobotics.org), provides fast and efficient asyncronous message passing, services, and data logging. +Gazebo Transport, a component of [Gazebo](https://gazebosim.org), provides fast and efficient asynchronous message passing, services, and data logging. # Table of Contents @@ -40,16 +40,16 @@ Ignition Transport, a component of [Ignition Robotics](https://ignitionrobotics. # Features -Ignition Transport is an open source communication library that allows +Gazebo Transport is an open source communication library that allows exchanging data between clients. In our context, a client is called a node. Nodes might be running within the same process in the same machine or in -machines located in different continents. Ignition Transport is multi-platform +machines located in different continents. Gazebo Transport is multi-platform (Linux, Mac OS X, and Windows), so all the low level details, such as data alignment or endianness are hidden for you. -Ignition Transport uses Google Protocol buffers as the data serialization format +Gazebo Transport uses Google Protocol buffers as the data serialization format for communicating between nodes. Users can define their own messages using the -Protobuf utils, and then, exchange them between the nodes. Ignition Transport +Protobuf utils, and then, exchange them between the nodes. Gazebo Transport discovers, serializes and delivers messages to the destinations using a combination of custom code and ZeroMQ. @@ -75,13 +75,13 @@ which version you need. ## Source Install -See the [install](https://ignitionrobotics.org/api/transport/8.0/installation.html) +See the [install](https://gazebosim.org/api/transport/8.0/installation.html) section of the documentation. # Usage -See [tutorials](https://ignitionrobotics.org/api/transport/8.0/tutorials.html) -and the [example directory](https://github.com/ignitionrobotics/ign-transport/blob/ign-transport8/example/) +See [tutorials](https://gazebosim.org/api/transport/8.0/tutorials.html) +and the [example directory](https://github.com/gazebosim/gz-transport/blob/ign-transport8/example/) in the source code. ## Known issue of command line tools @@ -90,7 +90,7 @@ In the event that the installation is a mix of Debian and from source, command line tools from `ign-tools` may not work correctly. A workaround for a single package is to define the environment variable -`IGN_CONFIG_PATH` to point to the location of the Ignition library installation, +`IGN_CONFIG_PATH` to point to the location of the Gazebo library installation, where the YAML file for the package is found, such as ``` export IGN_CONFIG_PATH=/usr/local/share/ignition @@ -99,7 +99,7 @@ export IGN_CONFIG_PATH=/usr/local/share/ignition However, that environment variable only takes a single path, which means if the installations from source are in different locations, only one can be specified. -Another workaround for working with multiple Ignition libraries on the command +Another workaround for working with multiple Gazebo libraries on the command line is using symbolic links to each library's YAML file. ``` mkdir ~/.ignition/tools/configs -p @@ -111,46 +111,46 @@ ln -s /usr/local/share/ignition/transportlog7.yaml . export IGN_CONFIG_PATH=$HOME/.ignition/tools/configs ``` -This issue is tracked [here](https://github.com/ignitionrobotics/ign-tools/issues/8). +This issue is tracked [here](https://github.com/gazebosim/gz-tools/issues/8). # Documentation -Visit the [documentation page](https://ignitionrobotics.org/api/transport/8.0/index.html). +Visit the [documentation page](https://gazebosim.org/api/transport/8.0/index.html). # Folder Structure ``` -ign-transport +gz-transport ├── conf Configuration file for the integration with the `ign` CLI tool. -├── example Example programs that use most of the Ignition Transport API. +├── example Example programs that use most of the Gazebo Transport API. ├── include Header files that get installed. -├── log All the code related with Ignition Transport logging. +├── log All the code related with Gazebo Transport logging. ├── src Source code of the core library. ├── test A directory of integration, performance and regression tests. ├── tools Scripts for continuous integration testing. -└── tutorials A set of tutorials about Ignition Transport features. +└── tutorials A set of tutorials about Gazebo Transport features. ``` # Contributing -Please see -[CONTRIBUTING.md](https://github.com/ignitionrobotics/ign-gazebo/blob/main/CONTRIBUTING.md). +Please see the +[contributing gude](https://gazebosim.org/docs/all/contributing). # Code of Conduct Please see -[CODE_OF_CONDUCT.md](https://github.com/ignitionrobotics/ign-gazebo/blob/main/CODE_OF_CONDUCT.md). +[CODE_OF_CONDUCT.md](https://github.com/gazebosim/gz-sim/blob/main/CODE_OF_CONDUCT.md). # Versioning This library uses [Semantic Versioning](https://semver.org/). Additionally, -this library is part of the [Ignition Robotics project](https://ignitionrobotics.org) +this library is part of the [Gazebo project](https://gazebosim.org) which periodically releases a versioned set of compatible and complimentary -libraries. See the [Ignition Robotics website](https://ignitionrobotics.org) for +libraries. See the [Gazebo website](https://gazebosim.org) for version and release information. # License This library is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0). -See also the [LICENSE](https://github.com/ignitionrobotics/ign-transport/raw/main/LICENSE) +See also the [LICENSE](https://github.com/gazebosim/gz-transport/raw/main/LICENSE) file. From c0c54bb898685768a7e7d4cc952e7f3f4f386c79 Mon Sep 17 00:00:00 2001 From: Jenn Nguyen Date: Wed, 20 Jul 2022 16:48:48 -0700 Subject: [PATCH 3/3] fix bash completion for Fortress (#333) Signed-off-by: Jenn Nguyen --- src/CMakeLists.txt | 3 +-- src/cmd/CMakeLists.txt | 3 ++- src/cmd/ign_TEST.cc | 4 ++-- src/cmd/transport.bash_completion.sh | 11 +++-------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7aac8f219..37d39437d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,8 +44,7 @@ foreach(test ${test_list}) # multi-configuration generators, like Visual Studio. target_compile_definitions(${test} PRIVATE "DETAIL_IGN_TRANSPORT_TEST_DIR=\"$\"" - "IGN_TEST_LIBRARY_PATH=\"$\"" - "PROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\"") + "IGN_TEST_LIBRARY_PATH=\"$\"") endforeach() if(MSVC) diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index 594bebb35..50611a9b9 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -47,7 +47,8 @@ foreach(test ${test_list}) # multi-configuration generators, like Visual Studio. target_compile_definitions(${test} PRIVATE "DETAIL_IGN_TRANSPORT_TEST_DIR=\"$\"" - "IGN_TEST_LIBRARY_PATH=\"$\"") + "IGN_TEST_LIBRARY_PATH=\"$\"" + "PROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\"") endforeach() diff --git a/src/cmd/ign_TEST.cc b/src/cmd/ign_TEST.cc index 8aca607b4..26f2651f4 100644 --- a/src/cmd/ign_TEST.cc +++ b/src/cmd/ign_TEST.cc @@ -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; @@ -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; diff --git a/src/cmd/transport.bash_completion.sh b/src/cmd/transport.bash_completion.sh index 80c7282cd..d86785150 100644 --- a/src/cmd/transport.bash_completion.sh +++ b/src/cmd/transport.bash_completion.sh @@ -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 @@ -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 @@ -49,8 +44,8 @@ GZ_TOPIC_COMPLETION_LIST=" -i --info -e --echo -p --pub - --force-version - --versions + -v --version + --json-output " function _gz_service