File tree 5 files changed +44
-0
lines changed
5 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -420,6 +420,7 @@ bashcomp_DATA = 2to3 \
420
420
tox \
421
421
tracepath \
422
422
tree \
423
+ truncate \
423
424
tshark \
424
425
tsig-keygen \
425
426
tune2fs \
Original file line number Diff line number Diff line change
1
+ # truncate(1) completion -*- shell-script -*-
2
+
3
+ _comp_cmd_truncate ()
4
+ {
5
+ local cur prev words cword split
6
+ _init_completion -s || return
7
+
8
+ case $prev in
9
+ -! (-* )s | --size | --help | --version)
10
+ return
11
+ ;;
12
+ -! (-* )r | --reference)
13
+ _filedir
14
+ return
15
+ ;;
16
+ esac
17
+
18
+ $split && return
19
+
20
+ if [[ $cur == -* ]]; then
21
+ COMPREPLY=($( compgen -W ' $(_parse_help "$1")' -- " $cur " ) )
22
+ [[ ${COMPREPLY-} == * = ]] && compopt -o nospace
23
+ return
24
+ fi
25
+
26
+ _filedir
27
+ } &&
28
+ complete -F _comp_cmd_truncate truncate
29
+
30
+ # ex: filetype=sh
Original file line number Diff line number Diff line change @@ -612,6 +612,7 @@ EXTRA_DIST = \
612
612
test_tr.py \
613
613
test_tracepath.py \
614
614
test_tree.py \
615
+ test_truncate.py \
615
616
test_tshark.py \
616
617
test_tsig_keygen.py \
617
618
test_tune2fs.py \
Original file line number Diff line number Diff line change
1
+ import pytest
2
+
3
+
4
+ class TestTruncate :
5
+ @pytest .mark .complete ("truncate " )
6
+ def test_basic (self , completion ):
7
+ assert completion
8
+
9
+ @pytest .mark .complete ("truncate -" , require_cmd = True )
10
+ def test_options (self , completion ):
11
+ assert completion
Original file line number Diff line number Diff line change 379
379
tr
380
380
tracepath
381
381
tree
382
+ truncate
382
383
tshark
383
384
tsig-keygen
384
385
tune2fs
You can’t perform that action at this time.
0 commit comments