Skip to content

Commit bae3a6e

Browse files
committed
feat(pdftoppm): new completion
1 parent 4198e25 commit bae3a6e

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

completions/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ bashcomp_DATA = 2to3 \
295295
pack200 \
296296
passwd \
297297
patch \
298+
pdftoppm \
298299
pdftotext \
299300
perl \
300301
perlcritic \

completions/pdftoppm

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# bash completion for pdftoppm(1) -*- shell-script -*-
2+
3+
_comp_cmd_pdftoppm()
4+
{
5+
local cur prev words cword
6+
_init_completion || return
7+
8+
case $prev in
9+
-[flrxyWH] | -r[xy] | -scale?(-to-[xy]) | -jpegopt | -[ou]pw)
10+
return
11+
;;
12+
-tiffcompression)
13+
COMPREPLY=($(compgen -W 'none packbits jpeg lzw deflate' -- "$cur"))
14+
return
15+
;;
16+
-freetype | -aa | -aaVector)
17+
COMPREPLY=($(compgen -W 'yes no' -- "$cur"))
18+
return
19+
;;
20+
-thinlinemode)
21+
COMPREPLY=($(compgen -W 'none solid shape' -- "$cur"))
22+
return
23+
;;
24+
esac
25+
26+
if [[ $cur == -* ]]; then
27+
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
28+
return
29+
fi
30+
31+
[[ $prev == *.pdf ]] || _filedir pdf
32+
} &&
33+
complete -F _comp_cmd_pdftoppm pdftoppm
34+
35+
# ex: filetype=sh

test/t/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ EXTRA_DIST = \
425425
test_passwd.py \
426426
test_paste.py \
427427
test_patch.py \
428+
test_pdftoppm.py \
428429
test_pdftotext.py \
429430
test_perl.py \
430431
test_perlcritic.py \

test/t/test_pdftoppm.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import pytest
2+
3+
4+
class TestPdftoppm:
5+
@pytest.mark.complete("pdftoppm ")
6+
def test_files(self, completion):
7+
assert completion
8+
9+
@pytest.mark.complete("pdftoppm -")
10+
def test_options(self, completion):
11+
assert completion

0 commit comments

Comments
 (0)