Skip to content

Commit 231a39d

Browse files
committed
refactor(mtr): deprecate our completion, upstream >= 0.88 has one
https://github.com/traviscross/mtr/tree/v0.95/bash-completion While at it, add basic test.
1 parent 78337b1 commit 231a39d

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@ _comp_compgen_known_hosts__impl()
26972697
_comp_compgen -v known_hosts -c "$prefix$cur" ltrim_colon "${known_hosts[@]}"
26982698
}
26992699
complete -F _comp_complete_known_hosts traceroute traceroute6 \
2700-
fping fping6 telnet rsh rlogin ftp dig drill mtr ssh-installkeys showmount
2700+
fping fping6 telnet rsh rlogin ftp dig drill ssh-installkeys showmount
27012701

27022702
# Convert the word index in `words` to the index in `COMP_WORDS`.
27032703
# @param $1 Index in the array WORDS.

completions/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ bashcomp_DATA = 2to3 \
277277
mplayer \
278278
mr \
279279
msynctool \
280+
_mtr \
280281
mtx \
281282
munindoc \
282283
munin-node-configure \

completions/_mtr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# mtr(8) completion -*- shell-script -*-
2+
3+
# Use of this file is deprecated.
4+
# Upstream completion is available in mtr >= 0.88, use that instead.
5+
6+
complete -F _comp_complete_known_hosts mtr
7+
8+
# ex: filetype=sh

test/t/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ EXTRA_DIST = \
394394
test_mr.py \
395395
test_msgsnarf.py \
396396
test_msynctool.py \
397+
test_mtr.py \
397398
test_mtx.py \
398399
test_munin_node_configure.py \
399400
test_munin_run.py \

test/t/test_mtr.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import pytest
2+
3+
4+
class TestMtr:
5+
@pytest.mark.complete("mtr ")
6+
def test_basic(self, completion):
7+
assert completion

0 commit comments

Comments
 (0)