Skip to content

Commit d864a36

Browse files
authored
bugfix for #563 (#570)
Signed-off-by: Daisuke Sato <[email protected]>
1 parent f3a15e4 commit d864a36

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ros2cli/ros2cli/command/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import argparse
1717
import inspect
1818
import os
19-
import shlex
2019
import types
2120

2221
from ros2cli.entry_points import get_entry_points
@@ -201,7 +200,9 @@ def add_subparsers_on_demand(
201200
args = argv
202201
# for completion use the arguments provided by the argcomplete env var
203202
if _is_completion_requested():
204-
args = shlex.split(os.environ['COMP_LINE'])[1:]
203+
from argcomplete import split_line
204+
_, _, _, comp_words, _ = split_line(os.environ['COMP_LINE'])
205+
args = comp_words[1:]
205206
try:
206207
known_args, _ = root_parser.parse_known_args(args=args)
207208
except SystemExit:

0 commit comments

Comments
 (0)