summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-01-24 19:24:09 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-01-24 19:24:09 -0300
commit019f3cc463db63abc6460f97deb488deec43840b (patch)
tree08cd5387d6c8af6f688d6468c7e2ae9f25c449be
parent5732da2af736c40cf693354485446ab4867ecb4d (diff)
downloadbash-completion-019f3cc463db63abc6460f97deb488deec43840b.tar.gz
New upstream version 2.10upstream/2.10
-rw-r--r--.gitignore2
-rw-r--r--.shellcheckrc4
-rw-r--r--.travis.yml15
-rw-r--r--CHANGES200
-rw-r--r--CONTRIBUTING.md4
-rw-r--r--Makefile.am12
-rw-r--r--README.md18
-rw-r--r--bash-completion-config.cmake.in7
-rw-r--r--bash-completion.pc.in11
-rw-r--r--bash_completion103
-rw-r--r--bash_completion.sh.in9
-rw-r--r--completions/.gitignore3
-rw-r--r--completions/Makefile.am572
-rw-r--r--completions/_cal3
-rw-r--r--completions/_chsh3
-rw-r--r--completions/apt-get18
-rw-r--r--completions/badblocks5
-rw-r--r--completions/carton78
-rw-r--r--completions/chromium-browser21
-rw-r--r--completions/cppcheck4
-rw-r--r--completions/curl6
-rw-r--r--completions/dmypy47
-rw-r--r--completions/gcc82
-rw-r--r--completions/gprof10
-rw-r--r--completions/gssdp-discover31
-rw-r--r--completions/iconv2
-rw-r--r--completions/influx32
-rw-r--r--completions/ip2
-rw-r--r--completions/ipv6calc9
-rw-r--r--completions/java7
-rw-r--r--completions/lintian11
-rw-r--r--completions/lvm20
-rw-r--r--completions/lz45
-rw-r--r--completions/makepkg3
-rw-r--r--completions/man3
-rw-r--r--completions/op2
-rw-r--r--completions/perl91
-rw-r--r--completions/perltidy2
-rw-r--r--completions/pgrep2
-rw-r--r--completions/pkg-get2
-rw-r--r--completions/pkg_delete4
-rw-r--r--completions/pkgutil2
-rw-r--r--completions/postfix2
-rw-r--r--completions/pwck3
-rw-r--r--completions/ri2
-rw-r--r--completions/screen32
-rw-r--r--completions/shellcheck14
-rw-r--r--completions/smartctl7
-rw-r--r--completions/ssh75
-rw-r--r--completions/ssh-add10
-rw-r--r--completions/ssh-copy-id2
-rw-r--r--completions/ssh-keygen7
-rw-r--r--completions/sysctl2
-rw-r--r--completions/tar21
-rw-r--r--completions/timeout3
-rw-r--r--completions/tipc7
-rw-r--r--completions/tox13
-rw-r--r--completions/unrar2
-rw-r--r--completions/update-alternatives4
-rw-r--r--completions/update-rc.d11
-rw-r--r--completions/valgrind3
-rw-r--r--completions/wine2
-rw-r--r--completions/xsltproc4
-rw-r--r--completions/xvfb-run36
-rw-r--r--configure.ac7
-rw-r--r--helpers/Makefile.am2
-rwxr-xr-xsetup-symlinks.sh9
-rw-r--r--test/Makefile.am1
-rw-r--r--test/config/bashrc44
-rw-r--r--test/docker/Dockerfile6
-rw-r--r--test/docker/Dockerfile-centos611
-rw-r--r--test/docker/Dockerfile-fedoradev11
-rw-r--r--test/docker/Dockerfile-tools3
-rw-r--r--test/docker/Dockerfile-ubuntu1413
-rwxr-xr-xtest/docker/docker-script.sh10
-rw-r--r--test/fixtures/shared/.ssh/known_hosts1
-rw-r--r--test/fixtures/tox/tox.ini6
-rw-r--r--test/lib/completions/finger.exp7
-rw-r--r--test/lib/library.exp32
-rw-r--r--test/requirements.txt4
-rwxr-xr-xtest/runLint2
-rw-r--r--test/setup.cfg9
-rw-r--r--test/t/Makefile.am11
-rw-r--r--test/t/conftest.py81
-rw-r--r--test/t/test_2to3.py4
-rw-r--r--test/t/test_7z.py2
-rw-r--r--test/t/test_a2ps.py4
-rw-r--r--test/t/test_a2x.py4
-rw-r--r--test/t/test_abook.py2
-rw-r--r--test/t/test_aclocal.py4
-rw-r--r--test/t/test_acpi.py2
-rw-r--r--test/t/test_acroread.py2
-rw-r--r--test/t/test_adb.py4
-rw-r--r--test/t/test_alpine.py2
-rw-r--r--test/t/test_ant.py2
-rw-r--r--test/t/test_appdata_validate.py4
-rw-r--r--test/t/test_apt_cache.py2
-rw-r--r--test/t/test_arch.py2
-rw-r--r--test/t/test_arp.py9
-rw-r--r--test/t/test_arping.py2
-rw-r--r--test/t/test_arpspoof.py2
-rw-r--r--test/t/test_asciidoc.py4
-rw-r--r--test/t/test_automake.py4
-rw-r--r--test/t/test_autoscan.py4
-rw-r--r--test/t/test_autossh.py7
-rw-r--r--test/t/test_awk.py4
-rw-r--r--test/t/test_badblocks.py5
-rw-r--r--test/t/test_base64.py4
-rw-r--r--test/t/test_bash.py2
-rw-r--r--test/t/test_bc.py2
-rw-r--r--test/t/test_bind.py2
-rw-r--r--test/t/test_bison.py2
-rw-r--r--test/t/test_bzip2.py4
-rw-r--r--test/t/test_cal.py4
-rw-r--r--test/t/test_carton.py11
-rw-r--r--test/t/test_cat.py4
-rw-r--r--test/t/test_ccache.py10
-rw-r--r--test/t/test_ccze.py4
-rw-r--r--test/t/test_cfagent.py2
-rw-r--r--test/t/test_chage.py4
-rw-r--r--test/t/test_checksec.py2
-rw-r--r--test/t/test_chkconfig.py2
-rw-r--r--test/t/test_chmod.py2
-rw-r--r--test/t/test_chpasswd.py2
-rw-r--r--test/t/test_chromium_browser.py14
-rw-r--r--test/t/test_chronyc.py4
-rw-r--r--test/t/test_chroot.py4
-rw-r--r--test/t/test_chrpath.py2
-rw-r--r--test/t/test_chsh.py4
-rw-r--r--test/t/test_civclient.py2
-rw-r--r--test/t/test_civserver.py2
-rw-r--r--test/t/test_cksfv.py2
-rw-r--r--test/t/test_colordiff.py11
-rw-r--r--test/t/test_compgen.py7
-rw-r--r--test/t/test_configure.py2
-rw-r--r--test/t/test_convert.py4
-rw-r--r--test/t/test_cp.py4
-rw-r--r--test/t/test_cpan2dist.py2
-rw-r--r--test/t/test_cpio.py6
-rw-r--r--test/t/test_cppcheck.py2
-rw-r--r--test/t/test_createdb.py4
-rw-r--r--test/t/test_createuser.py2
-rw-r--r--test/t/test_cryptsetup.py4
-rw-r--r--test/t/test_csplit.py4
-rw-r--r--test/t/test_curl.py11
-rw-r--r--test/t/test_cut.py4
-rw-r--r--test/t/test_cvs.py4
-rw-r--r--test/t/test_cvsps.py2
-rw-r--r--test/t/test_date.py4
-rw-r--r--test/t/test_dcop.py11
-rw-r--r--test/t/test_dd.py8
-rw-r--r--test/t/test_declare.py4
-rw-r--r--test/t/test_deja_dup.py2
-rw-r--r--test/t/test_desktop_file_validate.py4
-rw-r--r--test/t/test_df.py4
-rw-r--r--test/t/test_dhclient.py2
-rw-r--r--test/t/test_dict.py2
-rw-r--r--test/t/test_diff.py2
-rw-r--r--test/t/test_dir.py4
-rw-r--r--test/t/test_display.py2
-rw-r--r--test/t/test_dmesg.py2
-rw-r--r--test/t/test_dmypy.py12
-rw-r--r--test/t/test_dnsspoof.py2
-rw-r--r--test/t/test_dpkg.py6
-rw-r--r--test/t/test_dpkg_deb.py2
-rw-r--r--test/t/test_dropdb.py4
-rw-r--r--test/t/test_dselect.py2
-rw-r--r--test/t/test_du.py4
-rw-r--r--test/t/test_dumpe2fs.py4
-rw-r--r--test/t/test_e2freefrag.py4
-rw-r--r--test/t/test_ecryptfs_migrate_home.py6
-rw-r--r--test/t/test_eject.py2
-rw-r--r--test/t/test_enscript.py2
-rw-r--r--test/t/test_env.py2
-rw-r--r--test/t/test_eog.py4
-rw-r--r--test/t/test_ether_wake.py10
-rw-r--r--test/t/test_evince.py4
-rw-r--r--test/t/test_expand.py2
-rw-r--r--test/t/test_explodepkg.py17
-rw-r--r--test/t/test_export.py2
-rw-r--r--test/t/test_faillog.py2
-rw-r--r--test/t/test_feh.py4
-rw-r--r--test/t/test_file.py2
-rw-r--r--test/t/test_filefrag.py4
-rw-r--r--test/t/test_filesnarf.py2
-rw-r--r--test/t/test_finger.py17
-rw-r--r--test/t/test_fio.py2
-rw-r--r--test/t/test_firefox.py2
-rw-r--r--test/t/test_flake8.py5
-rw-r--r--test/t/test_fmt.py4
-rw-r--r--test/t/test_fold.py2
-rw-r--r--test/t/test_freeciv.py2
-rw-r--r--test/t/test_freeciv_server.py2
-rw-r--r--test/t/test_fusermount.py4
-rw-r--r--test/t/test_gcc.py60
-rw-r--r--test/t/test_genisoimage.py4
-rw-r--r--test/t/test_geoiplookup.py2
-rw-r--r--test/t/test_getconf.py4
-rw-r--r--test/t/test_getent.py11
-rw-r--r--test/t/test_gkrellm.py2
-rw-r--r--test/t/test_gm.py6
-rw-r--r--test/t/test_gnokii.py6
-rw-r--r--test/t/test_gnome_mplayer.py11
-rw-r--r--test/t/test_gnome_screenshot.py2
-rw-r--r--test/t/test_gpasswd.py4
-rw-r--r--test/t/test_gperf.py2
-rw-r--r--test/t/test_gpg2.py2
-rw-r--r--test/t/test_gpgv.py2
-rw-r--r--test/t/test_gphoto2.py2
-rw-r--r--test/t/test_gprof.py2
-rw-r--r--test/t/test_grep.py2
-rw-r--r--test/t/test_groupadd.py2
-rw-r--r--test/t/test_groupdel.py4
-rw-r--r--test/t/test_groupmems.py2
-rw-r--r--test/t/test_groupmod.py2
-rw-r--r--test/t/test_grpck.py2
-rw-r--r--test/t/test_grub.py2
-rw-r--r--test/t/test_gssdp_discover.py22
-rw-r--r--test/t/test_gzip.py4
-rw-r--r--test/t/test_hcitool.py4
-rw-r--r--test/t/test_head.py2
-rw-r--r--test/t/test_hexdump.py2
-rw-r--r--test/t/test_host.py2
-rw-r--r--test/t/test_hostname.py2
-rw-r--r--test/t/test_hping2.py4
-rw-r--r--test/t/test_htop.py2
-rw-r--r--test/t/test_htpasswd.py4
-rw-r--r--test/t/test_hunspell.py2
-rw-r--r--test/t/test_hwclock.py2
-rw-r--r--test/t/test_iconv.py14
-rw-r--r--test/t/test_identify.py2
-rw-r--r--test/t/test_idn.py2
-rw-r--r--test/t/test_ifdown.py4
-rw-r--r--test/t/test_ifstat.py8
-rw-r--r--test/t/test_iftop.py6
-rw-r--r--test/t/test_ifup.py8
-rw-r--r--test/t/test_influx.py15
-rw-r--r--test/t/test_info.py2
-rw-r--r--test/t/test_inotifywait.py4
-rw-r--r--test/t/test_inotifywatch.py4
-rw-r--r--test/t/test_installpkg.py6
-rw-r--r--test/t/test_interdiff.py4
-rw-r--r--test/t/test_ionice.py2
-rw-r--r--test/t/test_iperf.py10
-rw-r--r--test/t/test_iperf3.py6
-rw-r--r--test/t/test_ipmitool.py4
-rw-r--r--test/t/test_iptables.py2
-rw-r--r--test/t/test_ipv6calc.py6
-rw-r--r--test/t/test_irb.py4
-rw-r--r--test/t/test_isort.py2
-rw-r--r--test/t/test_java.py33
-rw-r--r--test/t/test_javaws.py4
-rw-r--r--test/t/test_jpegoptim.py4
-rw-r--r--test/t/test_jq.py3
-rw-r--r--test/t/test_jshint.py4
-rw-r--r--test/t/test_jsonschema.py2
-rw-r--r--test/t/test_k3b.py4
-rw-r--r--test/t/test_kcov.py2
-rw-r--r--test/t/test_kdvi.py4
-rw-r--r--test/t/test_kill.py2
-rw-r--r--test/t/test_killall.py8
-rw-r--r--test/t/test_koji.py4
-rw-r--r--test/t/test_kpdf.py2
-rw-r--r--test/t/test_l2ping.py2
-rw-r--r--test/t/test_lastlog.py2
-rw-r--r--test/t/test_ld.py4
-rw-r--r--test/t/test_ldapvi.py2
-rw-r--r--test/t/test_ldd.py4
-rw-r--r--test/t/test_less.py2
-rw-r--r--test/t/test_lftp.py4
-rw-r--r--test/t/test_links.py2
-rw-r--r--test/t/test_lintian_info.py2
-rw-r--r--test/t/test_ln.py4
-rw-r--r--test/t/test_locale_gen.py5
-rw-r--r--test/t/test_lrzip.py4
-rw-r--r--test/t/test_ls.py4
-rw-r--r--test/t/test_lspci.py4
-rw-r--r--test/t/test_lsscsi.py2
-rw-r--r--test/t/test_lsusb.py5
-rw-r--r--test/t/test_lua.py4
-rw-r--r--test/t/test_luac.py4
-rw-r--r--test/t/test_luseradd.py2
-rw-r--r--test/t/test_luserdel.py4
-rw-r--r--test/t/test_lvchange.py2
-rw-r--r--test/t/test_lvcreate.py2
-rw-r--r--test/t/test_lvdisplay.py4
-rw-r--r--test/t/test_lvextend.py2
-rw-r--r--test/t/test_lvmdiskscan.py4
-rw-r--r--test/t/test_lvreduce.py2
-rw-r--r--test/t/test_lvremove.py2
-rw-r--r--test/t/test_lvrename.py2
-rw-r--r--test/t/test_lvresize.py2
-rw-r--r--test/t/test_lvs.py4
-rw-r--r--test/t/test_lvscan.py4
-rw-r--r--test/t/test_lz4.py4
-rw-r--r--test/t/test_lzip.py4
-rw-r--r--test/t/test_m4.py4
-rw-r--r--test/t/test_macof.py2
-rw-r--r--test/t/test_mailsnarf.py2
-rw-r--r--test/t/test_make.py8
-rw-r--r--test/t/test_makepkg.py7
-rw-r--r--test/t/test_man.py31
-rw-r--r--test/t/test_mc.py2
-rw-r--r--test/t/test_mcrypt.py8
-rw-r--r--test/t/test_md5sum.py4
-rw-r--r--test/t/test_medusa.py2
-rw-r--r--test/t/test_mencoder.py2
-rw-r--r--test/t/test_mii_diag.py4
-rw-r--r--test/t/test_mii_tool.py4
-rw-r--r--test/t/test_minicom.py2
-rw-r--r--test/t/test_mkdir.py4
-rw-r--r--test/t/test_mkfifo.py4
-rw-r--r--test/t/test_mknod.py4
-rw-r--r--test/t/test_mock.py6
-rw-r--r--test/t/test_modinfo.py4
-rw-r--r--test/t/test_modprobe.py2
-rw-r--r--test/t/test_monodevelop.py4
-rw-r--r--test/t/test_mplayer.py2
-rw-r--r--test/t/test_mr.py26
-rw-r--r--test/t/test_msgsnarf.py2
-rw-r--r--test/t/test_munin_node_configure.py11
-rw-r--r--test/t/test_munin_run.py2
-rw-r--r--test/t/test_munindoc.py3
-rw-r--r--test/t/test_mussh.py2
-rw-r--r--test/t/test_mutt.py2
-rw-r--r--test/t/test_mv.py4
-rw-r--r--test/t/test_mypy.py2
-rw-r--r--test/t/test_mysqladmin.py2
-rw-r--r--test/t/test_nc.py2
-rw-r--r--test/t/test_ncftp.py2
-rw-r--r--test/t/test_nethogs.py4
-rw-r--r--test/t/test_netstat.py4
-rw-r--r--test/t/test_newlist.py2
-rw-r--r--test/t/test_newusers.py4
-rw-r--r--test/t/test_ngrep.py2
-rw-r--r--test/t/test_nl.py4
-rw-r--r--test/t/test_nm.py4
-rw-r--r--test/t/test_nproc.py8
-rw-r--r--test/t/test_nsupdate.py2
-rw-r--r--test/t/test_ntpdate.py2
-rw-r--r--test/t/test_objcopy.py4
-rw-r--r--test/t/test_od.py4
-rw-r--r--test/t/test_oggdec.py2
-rw-r--r--test/t/test_op.py4
-rw-r--r--test/t/test_opera.py4
-rw-r--r--test/t/test_optipng.py4
-rw-r--r--test/t/test_passwd.py2
-rw-r--r--test/t/test_paste.py4
-rw-r--r--test/t/test_patch.py4
-rw-r--r--test/t/test_pdftotext.py4
-rw-r--r--test/t/test_perl.py34
-rw-r--r--test/t/test_perlcritic.py4
-rw-r--r--test/t/test_perldoc.py2
-rw-r--r--test/t/test_perltidy.py6
-rw-r--r--test/t/test_pgrep.py4
-rw-r--r--test/t/test_phing.py4
-rw-r--r--test/t/test_pidof.py6
-rw-r--r--test/t/test_pine.py2
-rw-r--r--test/t/test_pinfo.py2
-rw-r--r--test/t/test_ping.py2
-rw-r--r--test/t/test_pkg_config.py2
-rw-r--r--test/t/test_pkgadd.py3
-rw-r--r--test/t/test_pkgrm.py3
-rw-r--r--test/t/test_pkill.py4
-rw-r--r--test/t/test_pngfix.py2
-rw-r--r--test/t/test_portinstall.py5
-rw-r--r--test/t/test_portupgrade.py3
-rw-r--r--test/t/test_postcat.py4
-rw-r--r--test/t/test_postconf.py6
-rw-r--r--test/t/test_postfix.py5
-rw-r--r--test/t/test_postmap.py4
-rw-r--r--test/t/test_pr.py4
-rw-r--r--test/t/test_prelink.py2
-rw-r--r--test/t/test_protoc.py4
-rw-r--r--test/t/test_psql.py4
-rw-r--r--test/t/test_ptx.py4
-rw-r--r--test/t/test_pv.py2
-rw-r--r--test/t/test_pvchange.py2
-rw-r--r--test/t/test_pvcreate.py2
-rw-r--r--test/t/test_pvdisplay.py4
-rw-r--r--test/t/test_pvmove.py4
-rw-r--r--test/t/test_pvremove.py2
-rw-r--r--test/t/test_pvs.py4
-rw-r--r--test/t/test_pvscan.py4
-rw-r--r--test/t/test_pwck.py4
-rw-r--r--test/t/test_pwd.py2
-rw-r--r--test/t/test_pwdx.py12
-rw-r--r--test/t/test_pwgen.py2
-rw-r--r--test/t/test_pycodestyle.py2
-rw-r--r--test/t/test_pydoc.py6
-rw-r--r--test/t/test_pydocstyle.py2
-rw-r--r--test/t/test_pyflakes.py4
-rw-r--r--test/t/test_pylint.py2
-rw-r--r--test/t/test_pylint_3.py2
-rw-r--r--test/t/test_python.py4
-rw-r--r--test/t/test_python3.py4
-rw-r--r--test/t/test_qemu.py4
-rw-r--r--test/t/test_querybts.py2
-rw-r--r--test/t/test_quota.py4
-rw-r--r--test/t/test_quotacheck.py2
-rw-r--r--test/t/test_quotaon.py2
-rw-r--r--test/t/test_radvdump.py6
-rw-r--r--test/t/test_rdesktop.py2
-rw-r--r--test/t/test_rdict.py2
-rw-r--r--test/t/test_readelf.py2
-rw-r--r--test/t/test_repomanage.py4
-rw-r--r--test/t/test_reportbug.py2
-rw-r--r--test/t/test_reptyr.py2
-rw-r--r--test/t/test_ri.py4
-rw-r--r--test/t/test_rm.py4
-rw-r--r--test/t/test_rmdir.py4
-rw-r--r--test/t/test_rmmod.py2
-rw-r--r--test/t/test_rpm.py4
-rw-r--r--test/t/test_rpm2tgz.py4
-rw-r--r--test/t/test_rpmbuild.py2
-rw-r--r--test/t/test_rtcwake.py6
-rw-r--r--test/t/test_sbcl_mt.py1
-rw-r--r--test/t/test_sbopkg.py2
-rw-r--r--test/t/test_screen.py26
-rw-r--r--test/t/test_scrub.py4
-rw-r--r--test/t/test_sed.py2
-rw-r--r--test/t/test_seq.py2
-rw-r--r--test/t/test_setquota.py4
-rw-r--r--test/t/test_sftp.py4
-rw-r--r--test/t/test_sha1sum.py2
-rw-r--r--test/t/test_shar.py2
-rw-r--r--test/t/test_shellcheck.py6
-rw-r--r--test/t/test_sitecopy.py2
-rw-r--r--test/t/test_slapt_get.py4
-rw-r--r--test/t/test_slapt_src.py6
-rw-r--r--test/t/test_smartctl.py2
-rw-r--r--test/t/test_smbcacls.py2
-rw-r--r--test/t/test_smbclient.py2
-rw-r--r--test/t/test_smbcquotas.py2
-rw-r--r--test/t/test_smbget.py2
-rw-r--r--test/t/test_smbpasswd.py2
-rw-r--r--test/t/test_smbtar.py2
-rw-r--r--test/t/test_smbtree.py2
-rw-r--r--test/t/test_snownews.py2
-rw-r--r--test/t/test_sort.py2
-rw-r--r--test/t/test_split.py2
-rw-r--r--test/t/test_sqlite3.py4
-rw-r--r--test/t/test_ss.py6
-rw-r--r--test/t/test_ssh.py4
-rw-r--r--test/t/test_ssh_add.py9
-rw-r--r--test/t/test_ssh_copy_id.py2
-rw-r--r--test/t/test_ssh_keygen.py2
-rw-r--r--test/t/test_sshmitm.py2
-rw-r--r--test/t/test_sshow.py2
-rw-r--r--test/t/test_strace.py2
-rw-r--r--test/t/test_strings.py4
-rw-r--r--test/t/test_strip.py2
-rw-r--r--test/t/test_su.py4
-rw-r--r--test/t/test_sudo.py2
-rw-r--r--test/t/test_sum.py11
-rw-r--r--test/t/test_synclient.py6
-rw-r--r--test/t/test_sysbench.py6
-rw-r--r--test/t/test_sysctl.py5
-rw-r--r--test/t/test_tac.py2
-rw-r--r--test/t/test_tail.py2
-rw-r--r--test/t/test_tcpdump.py2
-rw-r--r--test/t/test_tcpnice.py2
-rw-r--r--test/t/test_tee.py4
-rw-r--r--test/t/test_texindex.py2
-rw-r--r--test/t/test_timeout.py2
-rw-r--r--test/t/test_touch.py2
-rw-r--r--test/t/test_tox.py12
-rw-r--r--test/t/test_tr.py2
-rw-r--r--test/t/test_tracepath.py2
-rw-r--r--test/t/test_tshark.py10
-rw-r--r--test/t/test_tune2fs.py4
-rw-r--r--test/t/test_udevadm.py6
-rw-r--r--test/t/test_ulimit.py2
-rw-r--r--test/t/test_uname.py2
-rw-r--r--test/t/test_unexpand.py4
-rw-r--r--test/t/test_uniq.py2
-rw-r--r--test/t/test_units.py4
-rw-r--r--test/t/test_unshunt.py2
-rw-r--r--test/t/test_update_alternatives.py2
-rw-r--r--test/t/test_upgradepkg.py4
-rw-r--r--test/t/test_urlsnarf.py2
-rw-r--r--test/t/test_uscan.py2
-rw-r--r--test/t/test_useradd.py2
-rw-r--r--test/t/test_userdel.py2
-rw-r--r--test/t/test_usermod.py2
-rw-r--r--test/t/test_valgrind.py8
-rw-r--r--test/t/test_vdir.py4
-rw-r--r--test/t/test_vgcfgbackup.py4
-rw-r--r--test/t/test_vgcfgrestore.py4
-rw-r--r--test/t/test_vgchange.py4
-rw-r--r--test/t/test_vgck.py4
-rw-r--r--test/t/test_vgconvert.py2
-rw-r--r--test/t/test_vgcreate.py6
-rw-r--r--test/t/test_vgdisplay.py2
-rw-r--r--test/t/test_vgexport.py4
-rw-r--r--test/t/test_vgextend.py4
-rw-r--r--test/t/test_vgimport.py4
-rw-r--r--test/t/test_vgmerge.py4
-rw-r--r--test/t/test_vgmknodes.py2
-rw-r--r--test/t/test_vgreduce.py4
-rw-r--r--test/t/test_vgremove.py4
-rw-r--r--test/t/test_vgrename.py4
-rw-r--r--test/t/test_vgs.py4
-rw-r--r--test/t/test_vgscan.py4
-rw-r--r--test/t/test_vgsplit.py4
-rw-r--r--test/t/test_vipw.py2
-rw-r--r--test/t/test_vmstat.py2
-rw-r--r--test/t/test_vpnc.py2
-rw-r--r--test/t/test_watch.py2
-rw-r--r--test/t/test_wc.py2
-rw-r--r--test/t/test_webmitm.py2
-rw-r--r--test/t/test_wget.py2
-rw-r--r--test/t/test_who.py4
-rw-r--r--test/t/test_wol.py4
-rw-r--r--test/t/test_wsimport.py11
-rw-r--r--test/t/test_wtf.py3
-rw-r--r--test/t/test_wvdial.py2
-rw-r--r--test/t/test_xdg_settings.py4
-rw-r--r--test/t/test_xfreerdp.py14
-rw-r--r--test/t/test_xgamma.py4
-rw-r--r--test/t/test_xmllint.py2
-rw-r--r--test/t/test_xmlwf.py4
-rw-r--r--test/t/test_xmms.py2
-rw-r--r--test/t/test_xmodmap.py2
-rw-r--r--test/t/test_xrandr.py6
-rw-r--r--test/t/test_xrdb.py4
-rw-r--r--test/t/test_xsltproc.py2
-rw-r--r--test/t/test_xvfb_run.py12
-rw-r--r--test/t/test_xxd.py2
-rw-r--r--test/t/test_xz.py4
-rw-r--r--test/t/test_xzdec.py4
-rw-r--r--test/t/test_ypcat.py2
-rw-r--r--test/t/test_ypmatch.py3
-rw-r--r--test/t/test_yum.py2
-rw-r--r--test/t/test_zopfli.py4
-rw-r--r--test/t/test_zopflipng.py4
-rw-r--r--test/t/unit/Makefile.am4
-rw-r--r--test/t/unit/test_unit_filedir.py118
-rw-r--r--test/t/unit/test_unit_ip_addresses.py4
-rw-r--r--test/t/unit/test_unit_quote.py36
-rw-r--r--test/t/unit/test_unit_variables.py41
-rw-r--r--test/unit/_filedir.exp82
-rw-r--r--test/unit/_variables.exp39
-rw-r--r--test/unit/compgen.exp35
-rw-r--r--test/unit/quote.exp65
545 files changed, 2862 insertions, 1443 deletions
diff --git a/.gitignore b/.gitignore
index a7d66548..d58464b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ autom4te.cache
config.log
config.status
configure
+configure.lineno
install-sh
missing
doc/*.xml
@@ -20,6 +21,7 @@ __pycache__/
.pytest_cache/
.python-version
pytestdebug.log
+.mypy_cache/
helpers/perl.bak
helpers/perl.tdy
helpers/perl.ERR
diff --git a/.shellcheckrc b/.shellcheckrc
index bb16bdda..9bec7145 100644
--- a/.shellcheckrc
+++ b/.shellcheckrc
@@ -1,2 +1,4 @@
shell=bash
-disable=SC1090,SC2039,SC2128,SC2155,SC2166
+disable=SC1090 # not really fixable usually (ever?)
+disable=SC2128 # intentional style choice
+disable=SC2155 # TODO
diff --git a/.travis.yml b/.travis.yml
index 7f7bd35e..9e793d9b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,23 +6,26 @@ services:
- docker
env:
+ - DIST=alpine
- DIST=centos6
+ - DIST=debian10
- DIST=fedoradev
- DIST=ubuntu14
- DIST=ubuntu14 BSD=true NETWORK=none
- DIST=tools
before_install:
- - docker build -t bash-completion:$DIST -f test/docker/Dockerfile-$DIST .
+ - docker build
+ --build-arg DIST=$DIST -t bash-completion:$DIST -f test/docker/Dockerfile .
script:
- docker run --name bash-completion
- -e CI=true -e DIST=$DIST -e BSD=$BSD
+ -e CI=true -e DIST=$DIST -e BSD=$BSD -e NETWORK=$NETWORK
${NETWORK:+--network $NETWORK}
- -t bash-completion:$DIST test/docker/docker-script.sh
+ -t bash-completion:$DIST
- if test $DIST = tools; then
- test/run-shellcheck -f gcc bash_completion completions/!(Makefile*);
- test/run-shellcheck -f gcc -s sh bash_completion.sh.in;
+ test/run-shellcheck -f gcc
+ bash_completion bash_completion.sh.in completions/!(Makefile*);
fi
before_deploy:
@@ -39,5 +42,5 @@ deploy:
skip_cleanup: true
on:
repo: scop/bash-completion
- condition: $DIST = fedoradev
+ condition: $DIST = alpine
tags: true
diff --git a/CHANGES b/CHANGES
index 60a81a18..cfd18c4a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,203 @@
+bash-completion (2.10)
+
+ [ Felix Lechner ]
+ * perltidy: associate *.t (#338)
+
+ [ Gabriel F. T. Gomes ]
+ * perl: fix completion with space between option and argument
+
+ [ Grisha Levit ]
+ * _variables: add TERM and LC_* completion (#353)
+
+ [ IƱigo Martƭnez ]
+ * autotools: Replace pkgdatadir with datadir
+ * pkg-config: Relative paths
+ * pkg-config: generate Name from autotools PACKAGE
+
+ [ Jakub Jelen ]
+ * ssh: option and argument completion updates (#332)
+
+ [ Michał GĆ³rny ]
+ * test_arp: Skip if ARP tables are empty
+ * test_chromium_browser: Skip test_2 if 'chromium-browser --help'
+ fails
+ * test_rpm2tgz: Fix expected output
+
+ [ Sebastian ]
+ * cppcheck: Add new standards to --std option. (#356)
+
+ [ Tomasz N ]
+ * apt-get: fix pkg version completion if it contains a colon (#351)
+
+ [ Ville SkyttƤ ]
+ * test: bump black to >=19.10b0
+ * ssh, scp, sftp, ssh-copy-id, curl: improve identity file
+ completion
+ * update-rc.d: indentation fix
+ * update-rc.d: remove dead code
+ * screen: add serial device basic arg (non)completion
+ * screen: add //telnet completion
+ * test: add some trivial perl -E/-e cases
+ * perl: indentation fixes
+ * curl: make @filename completion do the right thing with dirs
+ * _filedir: avoid duplicate dirs internally, and a compgen -d call
+ for files
+ * _filedir: remove unused $x
+ * bash_completion.sh: shellcheck SC2086 fixes
+ * test: shellcheck config cleanups
+ * shellcheck: add some option arg (non)completions
+ * test: fix cpio users test in presence of usernames with whitespace
+ * test: python typing fixes
+ * test: add minimal mypy config
+ * .gitignore: mypy cache
+ * makepkg: fix option completion
+ * test: mark dcop and mr testcases requiring the cmd as such
+ * CONTRIBUTING: disable e-mail bug gateway due to spam
+ * carton: new completion
+ * op: direct command parsing stderr to /dev/null
+ * test: adjust java expectations based on whether jars can be listed
+ * valgrind: look tool names from lib/*-linux-gnu dirs too
+ * test: xfail locale-gen option completion if --help is not
+ available
+ * _sysvdirs: always return 0
+ * java: don't assume jar is installed
+ * travis: test with Debian 10
+ * wine: install for wine-development and wine-stable too
+ * travis: generate dist tarball on alpine
+ * dmypy: new completion
+ * test: add require_longopt xfail helper, use it
+ * test: mark more tests that parse command output as requiring
+ command
+ * sysctl: invoke completed sysctl instead of one from path to get
+ variables
+ * screen, smartctl, update-alternatives: _parse_help, drop hardcoded
+ option list
+ * lintian-info: _parse_help, add more option arg (non)completions
+ * gprof: _parse_usage, drop hardcoded option list
+ * test: fix retrieving command to test from request
+ * travis: pass NETWORK as env var, so we can actually use it
+ * test: xfail MAC address completion without networking
+ * test: ignore _makepkg_bootstrap in makepkg test env
+ * test: hush flake8-bugbear B010
+ * test: don't sort expected completion lists under the hood
+ * test: add bunch of basic option parsing test cases
+ * test: always run tests which don't require tested command
+ * test: explodepkg and upgradepkg test fixes
+ * test: mark sbcl-mt xfail due to whitespace split issues
+ * _terms: search directly from various terminfo dirs
+ * _terms: combine and simplify somewhat
+ * pkg-get: fix $i leak
+ * pkgutil: fix $i leak
+ * test: portinstall/upgrade test case and setup fixes
+ * lvm pv*, vg*: parse help instead of hardcoding option list
+ * ipv6calc: parse help instead of hardcoding option list
+ * test: avoid some sed -r/-E runLint false positives
+ * test: use sh +* as ccache command test case
+ * java: make jar/zip listing work with unzip
+ * test: installpkg test fixes
+ * test: fix acroread fixture dir
+ * test: remove unnecessary returns after pytest.skip
+ * test: avoid gnome-mplayer core dump on Ubuntu 14
+ * xvfb-run: new completion
+ * test: skip gssdp-discover --message-type when option not available
+ * test: expect failures for bc without --help useful with _longopt
+ * test: don't expect a .tox dir in fixture
+ * test: drop sourcing our no longer existing profile.d script
+ * tox: include -- in option completions
+ * tox: complete defaults after a --
+ * gssdp-discover: new completion
+ * test: register our pytest markers to hush warnings from 4.5+
+ * test: fix required pytest version
+ * ip: invoke the tool as $1
+ * README: drop distro badges, link to Repology instead
+ * chromium-browser: add --proxy-server arg completion
+ * test: source our profile.d test env script in docker
+ * influx: new completion
+ * README: badge title tweaks
+ * tox: do simple parse on tox.ini if --listenvs* yields nothing
+ * test: add basic tox fixture
+ * man: fall back to _parse_usage for _parse_help
+ * test_wsimport: xfail options test on unparseable -help
+ * test: don't try to install black on Python < 3.6
+ * pgrep: fix fallback to _parse_usage
+ * test: xfail unparseable mock and munin-node-configure --help cases
+ * test_pwdx: xfail more unparseable help cases
+ * build: make pytest executable configurable, look for pytest-3 too
+ * test: enforce minimum pytest version
+ * test: zopflipng flake8 fix
+ * test: xfail getent and pwdx option completions with unparseable
+ --help
+ * test: add more basic _parse_help use test cases
+ * test: add bunch of basic _parse_help use test cases
+ * .gitignore: add configure.lineno
+ * badblocks: fix $i leak
+ * postfix: option completion is expected to fail at the moment
+ * cal: try _parse_help before _parse_usage
+ * test: add bunch of basic _parse_usage use test cases
+ * chsh, pwck: try _parse_help before _parse_usage
+ * test: add basic autossh test
+ * test: convert more _filedir unit tests to pytest+pexpect
+ * test: flake8 fix
+ * test: convert bunch of _filedir unit tests to pytest+pexpect
+ * test: convert finger partial test case to pytest+pexpect
+ * README: add some badges, tweak existing
+ * test: port _variables unit tests to pytest+pexpect
+ * test: port compgen and quote tests to pytest+pexpect
+ * iconv, lz4, tipc, xsltproc: replace some seds with compgen -X
+ * test: disallow Alpine failure on Travis
+ * _pnames: adapt for busybox ps, rewrite in pure bash
+ * test: run our docker script in test containers by default
+ * test: use one Dockerfile for all dists
+ * test_ifup: accept short option completions too
+ * timeout: fallback to _parse_usage from _parse_help
+ * test_wget: test --s instead of --h
+ * test_lsusb: xfail with unparseable --help
+ * test: expect failures for various completions without useful
+ --help
+ * test: support xfail in our markers like skipif, use it a lot
+ * test: add Alpine Linux container, allow failures for now
+ * iconv: weed out ... from encoding completions
+ * test_iconv: add basic file completion test
+ * test_iconv: skip option completion if --help fails
+ * test_getconf: skip if -a doesn't output any POSIX_V*
+ * test_feh, test_makepkg: invoke grep as "command grep"
+ * test: generalize check whether we're being run in a container
+ * tar: simplify locating tarball from command line
+ * pkg_delete: don't limit to FreeBSD
+ * test: reformat test_chromium_browser.py source
+ * test: set up BASH_COMPLETION_COMPAT_DIR in bashrc (only)
+ * test: more thorough system location interference avoidance
+ * test: bashrc comment and whitespace tweaks
+ * build: makefile whitespace tweaks
+ * build: really reset return value before completions check
+ * build: simplify symlink setup
+ * tar: add missing bsdtar, gtar, and star symlinks
+ * README: use light gray badges for unknown versions
+ * README: link to cygwin package
+
+ [ Wolf ]
+ * ri: hush some warnings
+
+ [ andreabravetti ]
+ * unrar: complete on *.exe (#337)
+
+ [ ezr ]
+ * chromium-browser: Add support for .mhtml files
+
+ [ jerkey ]
+ * screen: complete first arg with serial devices
+
+ [ marxin ]
+ * gcc: support new --completion option (#222)
+
+ [ pcc ]
+ * unzip, zipinfo: complete *.aab (#340)
+
+ [ versat ]
+ * cppcheck: Remove deprecated option 'posix' for '--std='
+
+ -- Ville SkyttƤ <ville.skytta@iki.fi> Thu, 05 Dec 2019 17:04:26 +0200
+
bash-completion (2.9)
[ Antonio Terceiro ]
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 44865ba7..7f5a0962 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -173,9 +173,7 @@ Also, please bare the following coding guidelines in mind:
run-shellcheck.
- File bugs, enhancement, and pull requests at GitHub,
- https://github.com/scop/bash-completion or send them to the email
- gateway address bash-completion@fire.fundersclub.com which will pipe
- them to GitHub issues (with your email address visible).
+ https://github.com/scop/bash-completion.
Sending them to the developers might work too, but is really strongly
discouraged as bits are more likely to fall through the cracks that
way compared to the tracker. Just use GitHub. If that's not an
diff --git a/Makefile.am b/Makefile.am
index 8f441185..26f3c7c2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,7 @@ SUBDIRS = completions doc helpers test
pkgdata_DATA = bash_completion
# Empty, but here just to get the compat dir created with install
+compatdir = $(sysconfdir)/bash_completion.d
compat_DATA =
profiledir = $(sysconfdir)/profile.d
@@ -18,8 +19,9 @@ cmakeconfig_DATA = bash-completion-config.cmake \
%: %.in Makefile
$(SED) \
-e 's|@prefix[@]|$(prefix)|' \
- -e 's|@compatdir[@]|$(compatdir)|' \
- -e 's|@pkgdatadir[@]|$(pkgdatadir)|' \
+ -e 's|@datadir[@]|$(datadir)|' \
+ -e 's|@sysconfdir[@]|$(sysconfdir)|' \
+ -e 's|@PACKAGE[@]|$(PACKAGE)|' \
-e 's|@VERSION[@]|$(VERSION)|' \
<$(srcdir)/$@.in >$@
@@ -29,11 +31,11 @@ CLEANFILES = bash_completion.sh bash-completion.pc \
EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \
.editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc \
.shellcheckrc bash-completion.pc.in bash-completion-config.cmake.in \
- bash-completion-config-version.cmake.in
+ bash-completion-config-version.cmake.in setup-symlinks.sh
install-data-hook:
tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \
$(SED) -e 's|-/etc/bash_completion\.d|-$(compatdir)|' \
- $(DESTDIR)$(pkgdatadir)/bash_completion >$$tmpfile && \
- cat $$tmpfile >$(DESTDIR)$(pkgdatadir)/bash_completion && \
+ $(DESTDIR)$(datadir)/$(PACKAGE)/bash_completion >$$tmpfile && \
+ cat $$tmpfile >$(DESTDIR)$(datadir)/$(PACKAGE)/bash_completion && \
rm $$tmpfile
diff --git a/README.md b/README.md
index 06984a10..e78cf189 100644
--- a/README.md
+++ b/README.md
@@ -4,21 +4,9 @@
## Installation
-The easiest way to install this software is to use a package; it is
-available in many operating system distributions, some examples are listed
-below. The package's name is usually bash-completion.
-
-[![Alpine](https://img.shields.io/badge/Alpine-%28see%20website%29-brightgreen.svg)](https://pkgs.alpinelinux.org/packages?name=bash-completion)
-[![Arch](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fwww.archlinux.org%2Fpackages%2Fextra%2Fany%2Fbash-completion%2Fjson%2F&query=%24.pkgver&label=Arch)](https://www.archlinux.org/packages/extra/any/bash-completion/)
-[![Debian](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapi.ftp-master.debian.org%2Fmadison%3Fpackage%3Dbash-completion%26f%3Djson%26s%3Dunstable&query=%24..source_version&label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1)
-[![Fedora](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapps.fedoraproject.org%2Fmdapi%2Frawhide%2Fpkg%2Fbash-completion&query=%24.version&label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion)
-[![FreshPorts](https://img.shields.io/badge/FreshPorts-%28see%20website%29-brightgreen.svg)](https://www.freshports.org/shells/bash-completion)
-[![Gentoo](https://img.shields.io/badge/Gentoo-%28see%20website%29-brightgreen.svg)](https://packages.gentoo.org/packages/app-shells/bash-completion)
-[![Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg)](http://formulae.brew.sh/formula/bash-completion%402)
-[![OpenCSW](https://img.shields.io/badge/OpenCSW-%28see%20website%29-brightgreen.svg)](https://www.opencsw.org/package/bash_completion/)
-[![openSUSE](https://img.shields.io/badge/openSUSE-%28see%20website%29-brightgreen.svg)](https://software.opensuse.org/package/bash-completion?baseproject=openSUSE%3AFactory)
-[![Slackware](https://img.shields.io/badge/Slackware-%28see%20website%29-brightgreen.svg)](https://packages.slackware.com/?search=bash-completion)
-[![Ubuntu](https://img.shields.io/badge/Ubuntu-%28see%20website%29-brightgreen.svg)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1)
+The easiest way to install this software is to use a package; refer to
+[Repology](https://repology.org/project/bash-completion) for a comprehensive
+list of operating system distributions, package names, and available versions.
Depending on the package, you may still
need to source it from either `/etc/bashrc` or `~/.bashrc` (or any
diff --git a/bash-completion-config.cmake.in b/bash-completion-config.cmake.in
index d907b76c..2b7de6c9 100644
--- a/bash-completion-config.cmake.in
+++ b/bash-completion-config.cmake.in
@@ -4,8 +4,9 @@
set (BASH_COMPLETION_VERSION "@VERSION@")
set (BASH_COMPLETION_PREFIX "@prefix@")
-set (BASH_COMPLETION_COMPATDIR "@compatdir@")
-set (BASH_COMPLETION_COMPLETIONSDIR "@pkgdatadir@/completions")
-set (BASH_COMPLETION_HELPERSDIR "@pkgdatadir@/helpers")
+
+set (BASH_COMPLETION_COMPATDIR "@sysconfdir@/bash_completion.d")
+set (BASH_COMPLETION_COMPLETIONSDIR "@datadir@/@PACKAGE@/completions")
+set (BASH_COMPLETION_HELPERSDIR "@datadir@/@PACKAGE@/helpers")
set (BASH_COMPLETION_FOUND "TRUE")
diff --git a/bash-completion.pc.in b/bash-completion.pc.in
index ea03fd75..f0a3572c 100644
--- a/bash-completion.pc.in
+++ b/bash-completion.pc.in
@@ -1,9 +1,12 @@
prefix=@prefix@
-compatdir=@compatdir@
-completionsdir=@pkgdatadir@/completions
-helpersdir=@pkgdatadir@/helpers
+datadir=@datadir@
+sysconfdir=@sysconfdir@
-Name: bash-completion
+compatdir=${sysconfdir}/bash_completion.d
+completionsdir=${datadir}/@PACKAGE@/completions
+helpersdir=${datadir}/@PACKAGE@/helpers
+
+Name: @PACKAGE@
Description: programmable completion for the bash shell
URL: https://github.com/scop/bash-completion
Version: @VERSION@
diff --git a/bash_completion b/bash_completion
index 58987a7f..6ec510e5 100644
--- a/bash_completion
+++ b/bash_completion
@@ -23,7 +23,7 @@
#
# https://github.com/scop/bash-completion
-BASH_COMPLETION_VERSINFO=(2 9)
+BASH_COMPLETION_VERSINFO=(2 10)
if [[ $- == *v* ]]; then
BASH_COMPLETION_ORIGINAL_V_VALUE="-v"
@@ -99,6 +99,7 @@ _sysvdirs()
[[ -d /etc/init.d ]] && sysvdirs+=( /etc/init.d )
# Slackware uses /etc/rc.d
[[ -f /etc/slackware-version ]] && sysvdirs=( /etc/rc.d )
+ return 0
}
# This function checks whether we have a given program on the system.
@@ -556,27 +557,36 @@ _filedir()
_tilde "$cur" || return
local -a toks
- local x reset
-
- reset=$(shopt -po noglob); set -o noglob
- toks=( $(compgen -d -- "$cur") )
- IFS=' '; $reset; IFS=$'\n'
+ local reset
- if [[ "$1" != -d ]]; then
+ if [[ "$1" == -d ]]; then
+ reset=$(shopt -po noglob); set -o noglob
+ toks=( $(compgen -d -- "$cur") )
+ IFS=' '; $reset; IFS=$'\n'
+ else
local quoted
_quote_readline_by_ref "$cur" quoted
# Munge xspec to contain uppercase version too
# http://thread.gmane.org/gmane.comp.shells.bash.bugs/15294/focus=15306
- local xspec=${1:+"!*.@($1|${1^^})"}
+ local xspec=${1:+"!*.@($1|${1^^})"} plusdirs=()
+
+ # Use plusdirs to get dir completions if we have a xspec; if we don't,
+ # there's no need, dirs come along with other completions. Don't use
+ # plusdirs quite yet if fallback is in use though, in order to not ruin
+ # the fallback condition with the "plus" dirs.
+ local opts=( -f -X "$xspec" )
+ [[ $xspec ]] && plusdirs=(-o plusdirs)
+ [[ ${COMP_FILEDIR_FALLBACK-} ]] || opts+=( "${plusdirs[@]}" )
+
reset=$(shopt -po noglob); set -o noglob
- toks+=( $(compgen -f -X "$xspec" -- $quoted) )
+ toks+=( $(compgen "${opts[@]}" -- $quoted) )
IFS=' '; $reset; IFS=$'\n'
# Try without filter if it failed to produce anything and configured to
[[ -n ${COMP_FILEDIR_FALLBACK:-} && -n "$1" && ${#toks[@]} -lt 1 ]] && {
reset=$(shopt -po noglob); set -o noglob
- toks+=( $(compgen -f -- $quoted) )
+ toks+=( $(compgen -f "${plusdirs[@]}" -- $quoted) )
IFS=' '; $reset; IFS=$'\n'
}
fi
@@ -665,6 +675,15 @@ _variables()
done
return 0
;;
+ TERM)
+ _terms
+ return 0
+ ;;
+ LANG|LC_*)
+ COMPREPLY=( $(compgen -W '$(locale -a 2>/dev/null)' \
+ -- "$cur" ) )
+ return 0
+ ;;
esac
fi
return 1
@@ -1069,23 +1088,46 @@ _pnames()
} ||
_pnames()
{
+ local -a procs
if [[ "$1" == -s ]]; then
- COMPREPLY=( $(compgen -X '<defunct>' \
- -W '$(command ps axo comm | command sed -e 1d)' -- "$cur") )
+ procs=( $(command ps axo comm | command sed -e 1d) )
else
- # FIXME: completes "[kblockd/0]" to "0". Previously it was completed
- # to "kblockd" which isn't correct either. "kblockd/0" would be
- # arguably most correct, but killall from psmisc 22 treats arguments
- # containing "/" specially unless -r is given so that wouldn't quite
- # work either. Perhaps it'd be best to not complete these to anything
- # for now.
- COMPREPLY=( $(compgen -X '<defunct>' -W '$(command ps axo command= | command sed -e \
- "s/ .*//" -e \
- "s:.*/::" -e \
- "s/:$//" -e \
- "s/^[[(-]//" -e \
- "s/[])]$//" | sort -u)' -- "$cur") )
+ local line i=-1 OIFS=$IFS
+ IFS=$'\n'
+ local -a psout=( $(command ps axo command=) )
+ IFS=$OIFS
+ for line in "${psout[@]}"; do
+ if [[ $i -eq -1 ]]; then
+ # First line, see if it has COMMAND column header. For example
+ # the busybox ps does that, i.e. doesn't respect axo command=
+ if [[ $line =~ ^(.*[[:space:]])COMMAND([[:space:]]|$) ]]; then
+ # It does; store its index.
+ i=${#BASH_REMATCH[1]}
+ else
+ # Nope, fall through to "regular axo command=" parsing.
+ break
+ fi
+ else
+ #
+ line=${line:$i} # take command starting from found index
+ line=${line%% *} # trim arguments
+ procs+=( $line )
+ fi
+ done
+ if [[ $i -eq -1 ]]; then
+ # Regular axo command= parsing
+ for line in "${psout[@]}"; do
+ if [[ $line =~ ^[[(](.+)[])]$ ]]; then
+ procs+=( ${BASH_REMATCH[1]} )
+ else
+ line=${line%% *} # trim arguments
+ line=${line##@(*/|-)} # trim leading path and -
+ procs+=( $line )
+ fi
+ done
+ fi
fi
+ COMPREPLY=( $(compgen -X "<defunct>" -W '${procs[@]}' -- "$cur" ) )
}
# This function completes on user IDs
@@ -1402,11 +1444,12 @@ _dvd_devices()
# TERM environment variable values
_terms()
{
- COMPREPLY+=( $(compgen -W \
- "$(command sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap \
- 2>/dev/null)" -- "$cur") )
- COMPREPLY+=( $(compgen -W "$({ toe -a 2>/dev/null || toe 2>/dev/null; } \
- | awk '{ print $1 }' | sort -u)" -- "$cur") )
+ COMPREPLY+=( $(compgen -W "$({ \
+ command sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap;
+ { toe -a || toe; } | awk '{ print $1 }';
+ find /{etc,lib,usr/lib,usr/share}/terminfo/? -type f -maxdepth 1 \
+ | awk -F/ '{ print $NF }';
+ } 2>/dev/null)" -- "$cur") )
}
# a little help for FreeBSD ports users
@@ -1967,7 +2010,7 @@ _install_xspec()
}
# bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510
_install_xspec '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat lbunzip2 lbzcat
-_install_xspec '!*.@(zip|[egjswx]ar|exe|pk3|wsz|zargo|xpi|s[tx][cdiw]|sx[gm]|o[dt][tspgfc]|od[bm]|oxt|epub|apk|ipa|do[ct][xm]|p[op]t[mx]|xl[st][xm]|pyz|whl)' unzip zipinfo
+_install_xspec '!*.@(zip|[egjswx]ar|exe|pk3|wsz|zargo|xpi|s[tx][cdiw]|sx[gm]|o[dt][tspgfc]|od[bm]|oxt|epub|apk|aab|ipa|do[ct][xm]|p[op]t[mx]|xl[st][xm]|pyz|whl)' unzip zipinfo
_install_xspec '*.Z' compress znew
# zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510
_install_xspec '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat
diff --git a/bash_completion.sh.in b/bash_completion.sh.in
index a28e1a62..d23198fd 100644
--- a/bash_completion.sh.in
+++ b/bash_completion.sh.in
@@ -1,14 +1,15 @@
+# shellcheck shell=sh disable=SC1091,SC2039,SC2166
# Check for interactive bash and that we haven't already been sourced.
if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then
# Check for recent enough version of bash.
- if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
- [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
+ if [ "${BASH_VERSINFO[0]}" -gt 4 ] || \
+ [ "${BASH_VERSINFO[0]}" -eq 4 -a "${BASH_VERSINFO[1]}" -ge 1 ]; then
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
- if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then
+ if shopt -q progcomp && [ -r @datadir@/@PACKAGE@/bash_completion ]; then
# Source completion code.
- . @pkgdatadir@/bash_completion
+ . @datadir@/@PACKAGE@/bash_completion
fi
fi
diff --git a/completions/.gitignore b/completions/.gitignore
index 06f8d013..34167766 100644
--- a/completions/.gitignore
+++ b/completions/.gitignore
@@ -71,6 +71,7 @@ google-chrome
google-chrome-stable
gpc
gpgv2
+gtar
hciattach
hciconfig
hd
@@ -224,6 +225,8 @@ vgscan
vgsplit
vigr
whatis
+wine-development
+wine-stable
xpovray
xvnc4viewer
ypcat
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 94cca466..8f276d66 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -1,4 +1,4 @@
-bashcompdir = $(pkgdatadir)/completions
+bashcompdir = $(datadir)/$(PACKAGE)/completions
bashcomp_DATA = 2to3 \
7z \
a2x \
@@ -37,6 +37,7 @@ bashcomp_DATA = 2to3 \
_cal \
cancel \
cardctl \
+ carton \
ccache \
ccze \
cfagent \
@@ -79,6 +80,7 @@ bashcomp_DATA = 2to3 \
dhclient \
dict \
_dmesg \
+ dmypy \
dnssec-keygen \
dnsspoof \
dot \
@@ -143,6 +145,7 @@ bashcomp_DATA = 2to3 \
groupmod \
growisofs \
grpck \
+ gssdp-discover \
gzip \
hcitool \
hddtemp \
@@ -160,6 +163,7 @@ bashcomp_DATA = 2to3 \
ifstat \
iftop \
ifup \
+ influx \
info \
inject \
inotifywait \
@@ -451,6 +455,7 @@ bashcomp_DATA = 2to3 \
xrandr \
xrdb \
xsltproc \
+ xvfb-run \
xxd \
xz \
xzdec \
@@ -560,6 +565,7 @@ CLEANFILES = \
google-chrome-stable \
gpc \
gpgv2 \
+ gtar \
hciattach \
hciconfig \
hd \
@@ -724,379 +730,209 @@ CLEANFILES = \
xvnc4viewer \
ypcat
-symlinks: $(targetdir) $(DATA)
- for file in 7za ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) 7z $(targetdir)/$$file ; \
- done
- for file in aclocal-1.10 aclocal-1.11 aclocal-1.12 aclocal-1.13 \
- aclocal-1.14 aclocal-1.15 aclocal-1.16 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) aclocal $(targetdir)/$$file ; \
- done
- for file in phing ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) ant $(targetdir)/$$file ; \
- done
- for file in aptitude-curses ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) aptitude $(targetdir)/$$file ; \
- done
- for file in asciidoc.py ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) asciidoc $(targetdir)/$$file ; \
- done
- for file in automake-1.10 automake-1.11 automake-1.12 automake-1.13 \
- automake-1.14 automake-1.15 automake-1.16 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) automake $(targetdir)/$$file ; \
- done
- for file in autoheader ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) autoreconf $(targetdir)/$$file ; \
- done
- for file in autoupdate ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) autoscan $(targetdir)/$$file ; \
- done
- for file in btdownloadcurses.py btdownloadgui.py ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) btdownloadheadless.py $(targetdir)/$$file ; \
- done
- for file in lbzip2 pbzip2 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) bzip2 $(targetdir)/$$file ; \
- done
- for file in ncal ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) _cal $(targetdir)/$$file ; \
- done
- for file in pccardctl ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) cardctl $(targetdir)/$$file ; \
- done
- for file in google-chrome google-chrome-stable chromium chrome; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) chromium-browser $(targetdir)/$$file ; \
- done
- for file in compgen ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) complete $(targetdir)/$$file ; \
- done
- for file in mogrify display animate identify montage composite \
- compare conjure import stream ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) convert $(targetdir)/$$file ; \
- done
- for file in cowthink ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) cowsay $(targetdir)/$$file ; \
- done
- for file in rdict ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) dict $(targetdir)/$$file ; \
- done
- for file in dpkg-deb dpkg-query dpkg-reconfigure ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) dpkg $(targetdir)/$$file ; \
- done
- for file in etherwake ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) ether-wake $(targetdir)/$$file ; \
- done
- for file in mailsnarf msgsnarf ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) filesnarf $(targetdir)/$$file ; \
- done
- for file in iceweasel mozilla-firefox ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) firefox $(targetdir)/$$file ; \
- done
- for file in civclient freeciv-gtk2 freeciv-gtk3 freeciv-sdl \
- freeciv-xaw ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) freeciv $(targetdir)/$$file ; \
- done
- for file in civserver ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) freeciv-server $(targetdir)/$$file ; \
- done
- for file in declare typeset ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) function $(targetdir)/$$file ; \
- done
- for file in cc c++ g++ g++-5 g++-6 g++-7 g++-8 gfortran gfortran-5 \
- gfortran-6 gfortran-7 gfortran-8 f77 g77 f95 g95 gcj gpc \
- gccgo gccgo-5 gccgo-6 gccgo-7 gccgo-8 gcc-5 gcc-6 gcc-7 \
- gcc-8 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) gcc $(targetdir)/$$file ; \
- done
- for file in mkisofs ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) genisoimage $(targetdir)/$$file ; \
- done
- for file in geoiplookup6 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) geoiplookup $(targetdir)/$$file ; \
- done
- for file in gkrellm2 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) gkrellm $(targetdir)/$$file ; \
- done
- for file in gpgv2 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) gpgv $(targetdir)/$$file ; \
- done
- for file in pigz ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) gzip $(targetdir)/$$file ; \
- done
- for file in sdptool l2ping rfcomm ciptool dfutool hciconfig \
- hciattach ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) hcitool $(targetdir)/$$file ; \
- done
- for file in hd ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) _hexdump $(targetdir)/$$file ; \
- done
- for file in hping hping3 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) hping2 $(targetdir)/$$file ; \
- done
- for file in ifdown ifquery ifstatus ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) ifup $(targetdir)/$$file ; \
- done
- for file in pinfo ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) info $(targetdir)/$$file ; \
- done
- for file in inotifywatch ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) inotifywait $(targetdir)/$$file ; \
- done
- for file in insmod.static ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) insmod $(targetdir)/$$file ; \
- done
- for file in iperf3 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) iperf $(targetdir)/$$file ; \
- done
- for file in javac javadoc ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) java $(targetdir)/$$file ; \
- done
- for file in arm-koji ppc-koji s390-koji sparc-koji ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) koji $(targetdir)/$$file ; \
- done
- for file in ldapadd ldapmodify ldapdelete ldapcompare ldapmodrdn \
- ldapwhoami ldappasswd ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) ldapsearch $(targetdir)/$$file ; \
- done
- for file in links2 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) links $(targetdir)/$$file ; \
- done
- for file in lintian-info ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) lintian $(targetdir)/$$file ; \
- done
- for file in lusermod ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) luseradd $(targetdir)/$$file ; \
- done
- for file in lvmdiskscan pvscan pvs pvdisplay pvchange pvcreate pvmove \
- pvremove vgscan vgs vgdisplay vgchange vgremove vgrename \
- vgreduce vgextend vgimport vgexport vgck vgconvert vgcreate \
- vgcfgbackup vgcfgrestore vgmerge vgsplit vgmknodes lvscan lvs \
- lvdisplay lvchange lvcreate lvremove lvrename lvreduce \
- lvresize lvextend ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) lvm $(targetdir)/$$file ; \
- done
- for file in lz4c ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) lz4 $(targetdir)/$$file ; \
- done
- for file in clzip pdlzip plzip ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) lzip $(targetdir)/$$file ; \
- done
- for file in colormake gmake gnumake pmake ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) make $(targetdir)/$$file ; \
- done
- for file in apropos whatis ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) man $(targetdir)/$$file ; \
- done
- for file in mdecrypt ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) mcrypt $(targetdir)/$$file ; \
- done
- for file in mplayer2 mencoder gmplayer kplayer ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) mplayer $(targetdir)/$$file ; \
- done
- for file in muttng ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) mutt $(targetdir)/$$file ; \
- done
- for file in host ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) nslookup $(targetdir)/$$file ; \
- done
- for file in g4 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) p4 $(targetdir)/$$file ; \
- done
- for file in perldoc ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) perl $(targetdir)/$$file ; \
- done
- for file in alpine ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) pine $(targetdir)/$$file ; \
- done
- for file in ping6 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) ping $(targetdir)/$$file ; \
- done
- for file in pkg_info pkg_deinstall ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) pkg_delete $(targetdir)/$$file ; \
- done
- for file in pkill ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) pgrep $(targetdir)/$$file ; \
- done
- for file in pm-suspend pm-suspend-hybrid ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) pm-hibernate $(targetdir)/$$file ; \
- done
- for file in createdb createuser dropdb dropuser ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) psql $(targetdir)/$$file ; \
- done
- for file in postalias ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) postmap $(targetdir)/$$file ; \
- done
- for file in xpovray spovray ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) povray $(targetdir)/$$file ; \
- done
- for file in puppetmasterd puppetd puppetca ralsh puppetrun puppetqd \
- filebucket puppetdoc ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) puppet $(targetdir)/$$file ; \
- done
- for file in pytest-2 pytest-3 py.test py.test-2 py.test-3 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) pytest $(targetdir)/$$file ; \
- done
- for file in pydoc3 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) pydoc $(targetdir)/$$file ; \
- done
- for file in pylint-2 pylint-3 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) pylint $(targetdir)/$$file ; \
- done
- for file in pypy pypy3 python2 python3 micropython ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) python $(targetdir)/$$file ; \
- done
- for file in pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 \
- pyvenv-3.8 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) pyvenv $(targetdir)/$$file ; \
- done
- for file in dcop ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) qdbus $(targetdir)/$$file ; \
- done
- for file in qemu-kvm qemu-system-i386 qemu-system-x86_64 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) qemu $(targetdir)/$$file ; \
- done
- for file in setquota edquota quotacheck repquota quotaon quotaoff ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) quota $(targetdir)/$$file ; \
- done
- for file in ci co rlog rcsdiff ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) rcs $(targetdir)/$$file ; \
- done
- for file in rpmbuild rpmbuild-md5 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) rpm $(targetdir)/$$file ; \
- done
- for file in rpm2txz rpm2targz ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) rpm2tgz $(targetdir)/$$file ; \
- done
- for file in smbget smbcacls smbcquotas smbpasswd smbtar smbtree ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) smbclient $(targetdir)/$$file ; \
- done
- for file in sbcl-mt ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) sbcl $(targetdir)/$$file ; \
- done
- for file in slogin autossh sftp scp sidedoor ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) ssh $(targetdir)/$$file ; \
- done
- for file in sudoedit ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) sudo $(targetdir)/$$file ; \
- done
- for file in tracepath6 ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) tracepath $(targetdir)/$$file ; \
- done
- for file in alternatives ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) update-alternatives $(targetdir)/$$file ; \
- done
- for file in vigr ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) vipw $(targetdir)/$$file ; \
- done
- for file in tightvncviewer xvnc4viewer ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) vncviewer $(targetdir)/$$file ; \
- done
- for file in cdrecord ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) wodim $(targetdir)/$$file ; \
- done
- for file in pxz ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) xz $(targetdir)/$$file ; \
- done
- for file in ypcat ; do \
- rm -f $(targetdir)/$$file && \
- $(LN_S) ypmatch $(targetdir)/$$file ; \
- done
+symlinks: $(DATA)
+ $(ss) 7z \
+ 7za
+ $(ss) aclocal \
+ aclocal-1.10 aclocal-1.11 aclocal-1.12 aclocal-1.13 \
+ aclocal-1.14 aclocal-1.15 aclocal-1.16
+ $(ss) ant \
+ phing
+ $(ss) aptitude \
+ aptitude-curses
+ $(ss) asciidoc \
+ asciidoc.py
+ $(ss) automake \
+ automake-1.10 automake-1.11 automake-1.12 automake-1.13 \
+ automake-1.14 automake-1.15 automake-1.16
+ $(ss) autoreconf \
+ autoheader
+ $(ss) autoscan \
+ autoupdate
+ $(ss) btdownloadheadless.py \
+ btdownloadcurses.py btdownloadgui.py
+ $(ss) bzip2 \
+ lbzip2 pbzip2
+ $(ss) _cal \
+ ncal
+ $(ss) cardctl \
+ pccardctl
+ $(ss) chromium-browser \
+ chrome chromium google-chrome google-chrome-stable
+ $(ss) complete \
+ compgen
+ $(ss) convert \
+ animate compare composite conjure display identify import \
+ mogrify montage stream
+ $(ss) cowsay \
+ cowthink
+ $(ss) dict \
+ rdict
+ $(ss) dpkg \
+ dpkg-deb dpkg-query dpkg-reconfigure
+ $(ss) ether-wake \
+ etherwake
+ $(ss) filesnarf \
+ mailsnarf msgsnarf
+ $(ss) firefox \
+ iceweasel mozilla-firefox
+ $(ss) freeciv \
+ civclient freeciv-gtk2 freeciv-gtk3 freeciv-sdl freeciv-xaw
+ $(ss) freeciv-server \
+ civserver
+ $(ss) function \
+ declare typeset
+ $(ss) gcc \
+ c++ cc f77 f95 g++ g++-5 g++-6 g++-7 g++-8 g77 g95 gcc-5 \
+ gcc-6 gcc-7 gcc-8 gccgo gccgo-5 gccgo-6 gccgo-7 gccgo-8 gcj \
+ gfortran gfortran-5 gfortran-6 gfortran-7 gfortran-8 gpc
+ $(ss) genisoimage \
+ mkisofs
+ $(ss) geoiplookup \
+ geoiplookup6
+ $(ss) gkrellm \
+ gkrellm2
+ $(ss) gpgv \
+ gpgv2
+ $(ss) gzip \
+ pigz
+ $(ss) hcitool \
+ ciptool dfutool hciattach hciconfig l2ping rfcomm sdptool
+ $(ss) _hexdump \
+ hd
+ $(ss) hping2 \
+ hping hping3
+ $(ss) ifup \
+ ifdown ifquery ifstatus
+ $(ss) info \
+ pinfo
+ $(ss) inotifywait \
+ inotifywatch
+ $(ss) insmod \
+ insmod.static
+ $(ss) iperf \
+ iperf3
+ $(ss) java \
+ javac javadoc
+ $(ss) koji \
+ arm-koji ppc-koji s390-koji sparc-koji
+ $(ss) ldapsearch \
+ ldapadd ldapcompare ldapdelete ldapmodify ldapmodrdn \
+ ldappasswd ldapwhoami
+ $(ss) links \
+ links2
+ $(ss) lintian \
+ lintian-info
+ $(ss) luseradd \
+ lusermod
+ $(ss) lvm \
+ lvchange lvcreate lvdisplay lvextend lvmdiskscan lvreduce \
+ lvremove lvrename lvresize lvs lvscan pvchange pvcreate \
+ pvdisplay pvmove pvremove pvs pvscan vgcfgbackup vgcfgrestore \
+ vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend \
+ vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs \
+ vgscan vgsplit
+ $(ss) lz4 \
+ lz4c
+ $(ss) lzip \
+ clzip pdlzip plzip
+ $(ss) make \
+ colormake gmake gnumake pmake
+ $(ss) man \
+ apropos whatis
+ $(ss) mcrypt \
+ mdecrypt
+ $(ss) mplayer \
+ gmplayer kplayer mencoder mplayer2
+ $(ss) mutt \
+ muttng
+ $(ss) nslookup \
+ host
+ $(ss) p4 \
+ g4
+ $(ss) perl \
+ perldoc
+ $(ss) pine \
+ alpine
+ $(ss) ping \
+ ping6
+ $(ss) pkg_delete \
+ pkg_deinstall pkg_info
+ $(ss) pgrep \
+ pkill
+ $(ss) pm-hibernate \
+ pm-suspend pm-suspend-hybrid
+ $(ss) psql \
+ createdb createuser dropdb dropuser
+ $(ss) postmap \
+ postalias
+ $(ss) povray \
+ spovray xpovray
+ $(ss) puppet \
+ filebucket puppetca puppetd puppetdoc puppetmasterd puppetqd \
+ puppetrun ralsh
+ $(ss) pytest \
+ py.test py.test-2 py.test-3 pytest-2 pytest-3
+ $(ss) pydoc \
+ pydoc3
+ $(ss) pylint \
+ pylint-2 pylint-3
+ $(ss) python \
+ micropython pypy pypy3 python2 python3
+ $(ss) pyvenv \
+ pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 pyvenv-3.8
+ $(ss) qdbus \
+ dcop
+ $(ss) qemu \
+ qemu-kvm qemu-system-i386 qemu-system-x86_64
+ $(ss) quota \
+ edquota quotacheck quotaoff quotaon repquota setquota
+ $(ss) rcs \
+ ci co rcsdiff rlog
+ $(ss) rpm \
+ rpmbuild rpmbuild-md5
+ $(ss) rpm2tgz \
+ rpm2targz rpm2txz
+ $(ss) smbclient \
+ smbcacls smbcquotas smbget smbpasswd smbtar smbtree
+ $(ss) sbcl \
+ sbcl-mt
+ $(ss) ssh \
+ autossh scp sftp sidedoor slogin
+ $(ss) sudo \
+ sudoedit
+ $(ss) tar \
+ bsdtar gtar star
+ $(ss) tracepath \
+ tracepath6
+ $(ss) update-alternatives \
+ alternatives
+ $(ss) vipw \
+ vigr
+ $(ss) vncviewer \
+ tightvncviewer xvnc4viewer
+ $(ss) wine \
+ wine-development wine-stable
+ $(ss) wodim \
+ cdrecord
+ $(ss) xz \
+ pxz
+ $(ss) ypmatch \
+ ypcat
.PHONY: symlinks
-all-local: targetdir = .
+SETUP_SYMLINKS = $(srcdir)/../setup-symlinks.sh
+
+all-local: ss = $(SETUP_SYMLINKS) .
all-local: symlinks
-install-data-hook: targetdir = $(DESTDIR)$(bashcompdir)
+install-data-hook: ss = $(SETUP_SYMLINKS) $(DESTDIR)$(bashcompdir)
install-data-hook: symlinks
check-local:
- ret=0
- for file in $(bashcomp_DATA) ; do \
+ ret=0; \
+ for file in $(bashcomp_DATA); do \
$${bashcomp_bash:-$${BASH:-bash}} \
- -O extglob -n $(srcdir)/$$file || ret=$$? ; \
- done ; \
+ -O extglob -n $(srcdir)/$$file || ret=$$?; \
+ done; \
exit $$ret
diff --git a/completions/_cal b/completions/_cal
index 9aefa704..ed304aa7 100644
--- a/completions/_cal
+++ b/completions/_cal
@@ -24,7 +24,8 @@ _cal()
esac
if [[ $cur == -* ]]; then
- COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") )
+ local opts=$(_parse_help "$1")
+ COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") )
return
fi
diff --git a/completions/_chsh b/completions/_chsh
index 48473fe8..64ce5a1b 100644
--- a/completions/_chsh
+++ b/completions/_chsh
@@ -19,7 +19,8 @@ _chsh()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") )
+ local opts=$(_parse_help "$1")
+ COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") )
else
_allowed_users
fi
diff --git a/completions/apt-get b/completions/apt-get
index 3b00c56a..9c88fe60 100644
--- a/completions/apt-get
+++ b/completions/apt-get
@@ -2,8 +2,8 @@
_apt_get()
{
- local cur prev words cword
- _init_completion -n = || return
+ local cur prev words cword package
+ _init_completion -n ':=' || return
local special i
for (( i=0; i < ${#words[@]}-1; i++ )); do
@@ -34,11 +34,15 @@ _apt_get()
_filedir deb
return
elif [[ $cur == *=* ]]; then
- COMPREPLY=( $(compgen -W "$(\
- apt-cache --no-generate show "${cur%%=*}" 2>/dev/null |
- command sed -ne \
- 's/^Version:[[:space:]]*\([^[:space:]]\)/\1/p')" \
- -- "${cur#*=}") )
+ package="${cur%%=*}"
+ cur="${cur#*=}"
+ COMPREPLY=($(IFS=$'\n' compgen -W "$( \
+ apt-cache --no-generate madison "$package" 2>/dev/null | \
+ while IFS=' |' read -r _ version _; do
+ echo "$version"
+ done )" \
+ -- "$cur"))
+ __ltrim_colon_completions "$cur"
return
fi
;;&
diff --git a/completions/badblocks b/completions/badblocks
index a366338c..221f42b9 100644
--- a/completions/badblocks
+++ b/completions/badblocks
@@ -16,11 +16,8 @@ _badblocks()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") )
# Filter out -w (dangerous) and -X (internal use)
- for i in "${!COMPREPLY[@]}"; do
- [[ ${COMPREPLY[i]} == -[wX] ]] && unset 'COMPREPLY[i]'
- done
+ COMPREPLY=( $(compgen -X -[wX] -W '$(_parse_usage "$1")' -- "$cur") )
return
fi
diff --git a/completions/carton b/completions/carton
new file mode 100644
index 00000000..0cf6e2ca
--- /dev/null
+++ b/completions/carton
@@ -0,0 +1,78 @@
+# carton(3pm) completion -*- shell-script -*-
+
+_carton_commands()
+{
+ local cmds=$("${1:-carton}" usage 2>&1 | \
+ command sed -ne '/.*command.* is one of/{n;p;q}')
+ COMPREPLY+=( $(IFS="$IFS," compgen -W "$cmds" -- "$cur") )
+}
+
+_carton_command_help()
+{
+ local help=$(PERLDOC_PAGER=cat PERLDOC=-otext "${1:-carton}" -h $2 2>&1)
+ COMPREPLY+=( $(compgen -W '$help' -- "$cur") )
+}
+
+_carton()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ local i command
+ for (( i=1; i < cword; i++ )); do
+ case ${words[i]} in
+ -*) ;;
+ *) command=${words[i]}; break ;;
+ esac
+ done
+
+ if [[ -z "$command" ]]; then
+ _carton_commands "$1"
+ return
+ fi
+
+ case $prev in
+ --version|-v)
+ return
+ ;;
+ --help|-h)
+ [[ -n "$command" ]] || _carton_commands "$1"
+ return
+ ;;
+ --cpanfile)
+ if [[ $command == install ]]; then
+ _filedir
+ return
+ fi
+ ;;
+ --path)
+ if [[ $command == install ]]; then
+ _filedir -d
+ return
+ fi
+ ;;
+ --without)
+ if [[ $command == install ]]; then
+ local phases="configure build test runtime develop"
+ COMPREPLY+=( $(compgen -W '$phases' -- "$cur") )
+ return
+ fi
+ ;;
+ esac
+
+ $split && return
+
+ if [[ $cur == -* ]]; then
+ [[ $command == @(help|usage) ]] || COMPREPLY=(--help)
+ _carton_command_help "$1" $command
+ fi
+
+ case $command in
+ show|update)
+ : # TODO modules completion
+ ;;
+ esac
+} &&
+complete -F _carton carton
+
+# ex: filetype=sh
diff --git a/completions/chromium-browser b/completions/chromium-browser
index f8bebd97..a26b04f2 100644
--- a/completions/chromium-browser
+++ b/completions/chromium-browser
@@ -3,16 +3,31 @@
_chromium_browser()
{
local cur prev words cword split
- _init_completion -s || return
+ _init_completion -s -n : || return
case $prev in
- --help|--app|--proxy-server|--proxy-pac-url|-h)
+ --help|--app|--proxy-pac-url|-h)
return
;;
--user-data-dir)
_filedir -d
return
;;
+ --proxy-server)
+ case $cur in
+ *://*)
+ local prefix="${cur%%://*}://"
+ _known_hosts_real -- "${cur#*://}"
+ COMPREPLY=( "${COMPREPLY[@]/#/$prefix}" )
+ __ltrim_colon_completions "$cur"
+ ;;
+ *)
+ compopt -o nospace
+ COMPREPLY=( $(compgen -S :// -W 'http socks socks4 socks5' -- "$cur") )
+ ;;
+ esac
+ return
+ ;;
--password-store)
COMPREPLY=( $(compgen -W 'basic gnome kwallet' -- "$cur") )
return
@@ -27,7 +42,7 @@ _chromium_browser()
return
fi
- _filedir "@(?([xs])htm?(l)|pdf)"
+ _filedir "@(?([mxs])htm?(l)|pdf)"
} &&
complete -F _chromium_browser chromium-browser google-chrome \
google-chrome-stable chromium chrome
diff --git a/completions/cppcheck b/completions/cppcheck
index 2e487f81..ebc3ba3b 100644
--- a/completions/cppcheck
+++ b/completions/cppcheck
@@ -51,8 +51,8 @@ _cppcheck()
return
;;
--std)
- COMPREPLY=( $(compgen -W 'c89 c99 c11 c++03 c++11 posix' \
- -- "$cur") )
+ COMPREPLY=( $(compgen -W 'c89 c99 c11 c++03 c++11 c++14 c++17
+ c++20' -- "$cur") )
return
;;
--platform)
diff --git a/completions/curl b/completions/curl
index 2fe06272..d744e49a 100644
--- a/completions/curl
+++ b/completions/curl
@@ -43,6 +43,10 @@ _curl()
if [[ $cur == \@* ]]; then
cur=${cur:1}
_filedir
+ if [[ ${#COMPREPLY[@]} -eq 1 && -d "${COMPREPLY[0]}" ]]; then
+ COMPREPLY[0]+=/
+ compopt -o nospace
+ fi
COMPREPLY=( "${COMPREPLY[@]/#/@}" )
fi
return
@@ -72,7 +76,7 @@ _curl()
return
;;
--pubkey)
- _filedir pub
+ _xfunc ssh _ssh_identityfile pub
return
;;
--stderr)
diff --git a/completions/dmypy b/completions/dmypy
new file mode 100644
index 00000000..a8c07437
--- /dev/null
+++ b/completions/dmypy
@@ -0,0 +1,47 @@
+# dmypy completion -*- shell-script -*-
+
+_dmypy()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ --help|--version|-[hV])
+ return
+ ;;
+ --status-file)
+ _filedir
+ return
+ ;;
+ esac
+
+ local cmd i
+ for (( i=1; i < cword; i++ )); do
+ if [[ ${words[i]} != -* && ${words[i-1]} != --status-file ]]; then
+ cmd=${words[i]}
+ break
+ fi
+ done
+
+ case $cmd in
+ check|run)
+ _filedir '@(py|pyi)'
+ return
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
+ return
+ fi
+
+ if [[ ! $cmd ]]; then
+ local cmds=$($1 --help 2>&1 \
+ | command sed -ne '/positional arguments/{p;n;p;q}' \
+ | command sed -ne 's/{\(.*\)}/\1/p')
+ COMPREPLY=( $(IFS="," compgen -W '$cmds' -- "$cur") )
+ return
+ fi
+} &&
+complete -F _dmypy dmypy
+
+# ex: filetype=sh
diff --git a/completions/gcc b/completions/gcc
index b72bf972..86d0d095 100644
--- a/completions/gcc
+++ b/completions/gcc
@@ -1,50 +1,58 @@
# gcc(1) completion -*- shell-script -*-
-#
-# The only unusual feature is that we don't parse "gcc --help -v" output
-# directly, because that would include the options of all the other backend
-# tools (linker, assembler, preprocessor, etc) without any indication that
-# you cannot feed such options to the gcc driver directly. (For example, the
-# linker takes a -z option, but you must type -Wl,-z for gcc.) Instead, we
-# ask the driver ("g++") for the name of the compiler ("cc1"), and parse the
-# --help output of the compiler.
_gcc()
{
- local cur prev words cword
+ local cur prev prev2 words cword argument prefix prefix_length
_init_completion || return
- local cc backend
+ # Test that GCC is recent enough and if not fallback to
+ # parsing of --completion option.
+ if ! $1 --completion=" " 2>/dev/null; then
+ if [[ "$cur" == -* ]]; then
+ local cc=$($1 -print-prog-name=cc1 2>/dev/null)
+ [[ $cc ]] || return
+ COMPREPLY=($( compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' |\
+ command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \
+ -- "$cur" ))
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ else
+ _filedir
+ fi
+ return
+ fi
- case $1 in
- gcj)
- backend=jc1
- ;;
- gpc)
- backend=gpc1
- ;;
- *77)
- backend=f771
- ;;
- *95)
- backend=f951
- ;;
- *)
- backend=cc1 # (near-)universal backend
- ;;
- esac
+ # extract also for situations like: -fsanitize=add
+ if [[ $cword -gt 2 ]]; then
+ prev2="${COMP_WORDS[$cword - 2]}"
+ fi
+ # sample: -fsan
if [[ "$cur" == -* ]]; then
- cc=$($1 -print-prog-name=$backend 2>/dev/null)
- [[ $cc ]] || return
- # sink stderr:
- # for C/C++/ObjectiveC it's useless
- # for FORTRAN/Java it's an error
- COMPREPLY=( $(compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' |\
- command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \
- -- "$cur") )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- else
+ argument=$cur
+ prefix=""
+ # sample: -fsanitize=
+ elif [[ "$cur" == "=" && $prev == -* ]]; then
+ argument=$prev$cur
+ prefix=$prev$cur
+ # sample: -fsanitize=add
+ elif [[ "$prev" == "=" && $prev2 == -* ]]; then
+ argument=$prev2$prev$cur
+ prefix=$prev2$prev
+ # sample: --param lto-
+ elif [[ "$prev" == --param ]]; then
+ argument="$prev $cur"
+ prefix="$prev "
+ fi
+
+ if [[ -z $argument ]]; then
_filedir
+ else
+ # In situation like '-fsanitize=add' $cur is equal to last token.
+ # Thus we need to strip the beginning of suggested option.
+ prefix_length=$((${#prefix}+1))
+ local flags=$($1 --completion="$argument" | cut -c $prefix_length-)
+ [[ "${flags}" == "=*" ]] && compopt -o nospace 2>/dev/null
+ COMPREPLY=( $(compgen -W "$flags" -- "") )
fi
} &&
complete -F _gcc gcc{,-5,-6,-7,-8} g++{,-5,-6,-7,-8} g77 g95 \
diff --git a/completions/gprof b/completions/gprof
index d1f4a4a3..40a74820 100644
--- a/completions/gprof
+++ b/completions/gprof
@@ -44,15 +44,7 @@ _gprof()
$split && return
if [[ $cur == -* ]]; then
- COMPREPLY=( $(compgen -W '--annotated-source --brief --exec-counts
- --file-info --directory-path --no-annotated-source --print-path
- --flat-profile --no-flat-profile --graph --no-graph --table-length=
- --separate-files --no-exec-counts --function-ordering
- --file-ordering --traditional --width= --all-lines --demangle
- --no-demangle --no-static --static-call-graph
- --ignore-non-functions -k --line --min-count= --time= --no-time=
- --external-symbol-table= --display-unused-functions --debug --help
- --file-format= --sum --version' -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
diff --git a/completions/gssdp-discover b/completions/gssdp-discover
new file mode 100644
index 00000000..f0fa6955
--- /dev/null
+++ b/completions/gssdp-discover
@@ -0,0 +1,31 @@
+# bash completion for gssdp-discover -*- shell-script -*-
+
+_gssdp_discover()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ --help|--target|--timeout|--rescan-interval|-[htnr])
+ return
+ ;;
+ --interface|-i)
+ _available_interfaces -a
+ return
+ ;;
+ --message-type|-m)
+ local types=$($1 --help 2>&1 | \
+ command sed -ne 's/^.*--message-type=.*(\([^)]*\))$/\1/p')
+ COMPREPLY=( $(IFS+=,; compgen -W "$types" -- "$cur") )
+ return
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ fi
+} &&
+complete -F _gssdp_discover gssdp-discover
+
+# ex: filetype=sh
diff --git a/completions/iconv b/completions/iconv
index 2fb1c92d..372c525b 100644
--- a/completions/iconv
+++ b/completions/iconv
@@ -2,7 +2,7 @@
_iconv_charsets()
{
- COMPREPLY+=( $(compgen -W '$(${1:-iconv} -l | \
+ COMPREPLY+=( $(compgen -X ... -W '$(${1:-iconv} -l | \
command sed -e "s@/*\$@@" -e "s/[,()]//g")' -- "$cur") )
}
diff --git a/completions/influx b/completions/influx
new file mode 100644
index 00000000..bbedf10f
--- /dev/null
+++ b/completions/influx
@@ -0,0 +1,32 @@
+# bash completion for influx(8) -*- shell-script -*-
+
+_influx()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -version|-port|-database|-password|-username|-execute|-pps)
+ return
+ ;;
+ -host)
+ _known_hosts_real -- "$cur"
+ return
+ ;;
+ -format|-precision|-consistency)
+ local args=$($1 --help 2>&1 | awk "\$1 == \"$prev\" { print \$2 }")
+ COMPREPLY=( $(IFS+="\"'|"; compgen -W "$args" -- "$cur") )
+ return
+ ;;
+ -import|-path)
+ _filedir
+ return
+ ;;
+ esac
+
+ [[ "$cur" == -* ]] &&
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
+} &&
+complete -F _influx influx
+
+# ex: filetype=sh
diff --git a/completions/ip b/completions/ip
index 372d2d85..f7e6e7c2 100644
--- a/completions/ip
+++ b/completions/ip
@@ -49,7 +49,7 @@ _ip()
return
;;
*)
- COMPREPLY=( $(compgen -W "help $(ip help 2>&1 | command sed -e \
+ COMPREPLY=( $(compgen -W "help $($1 help 2>&1 | command sed -e \
'/OBJECT := /,/}/!d' -e \
's/.*{//' -e \
's/}.*//' -e \
diff --git a/completions/ipv6calc b/completions/ipv6calc
index f001999a..6a5771ef 100644
--- a/completions/ipv6calc
+++ b/completions/ipv6calc
@@ -28,13 +28,8 @@ _ipv6calc()
$split && return
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--help --debug --quiet --in --out --action
- --examples --showinfo --show_types --machine_readable --db-geoip
- --db-geoip-default --db-ip2location-ipv4 --db-ip2location-ipv6
- --lowercase --uppercase --printprefix --printsuffix --maskprefix
- --masksuffix --printstart --printend --printcompressed
- --printuncompressed --printfulluncompressed --printmirrored' \
- -- "$cur") )
+ COMPREPLY=( $(compgen -W '$("$1" -h 2>&1 |
+ command sed -e "s/[][]//g" | _parse_help -)' -- "$cur") )
fi
} &&
diff --git a/completions/java b/completions/java
index 3ca65869..89d207d2 100644
--- a/completions/java
+++ b/completions/java
@@ -64,7 +64,12 @@ _java_classes()
if type zipinfo &>/dev/null; then
COMPREPLY+=( $(zipinfo -1 "$i" "$cur*" 2>/dev/null | \
command grep '^[^$]*\.class$') )
- else
+ elif type unzip &>/dev/null; then
+ # Last column, between entries consisting entirely of dashes
+ COMPREPLY+=( $(unzip -lq "$i" "$cur*" 2>/dev/null | \
+ awk '$NF ~ /^-+$/ { flag=!flag; next };
+ flag && $NF ~ /^[^$]*\.class/ { print $NF }') )
+ elif type jar &>/dev/null; then
COMPREPLY+=( $(jar tf "$i" "$cur" | \
command grep '^[^$]*\.class$') )
fi
diff --git a/completions/lintian b/completions/lintian
index fbf54f96..d62d8373 100644
--- a/completions/lintian
+++ b/completions/lintian
@@ -149,15 +149,22 @@ _lintian_info()
_init_completion || return
case "$prev" in
+ --help|--profile)
+ return
+ ;;
-t|--tags)
_lintian_tags
- return 0
+ return
+ ;;
+ --include-dir)
+ _filedir -d
+ return
;;
esac
case "$cur" in
--*)
- COMPREPLY=($(compgen -W "--annotate --help --tags" -- "$cur"))
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
;;
*)
_filedir
diff --git a/completions/lvm b/completions/lvm
index 63048aeb..712838c8 100644
--- a/completions/lvm
+++ b/completions/lvm
@@ -81,9 +81,7 @@ _pvscan()
_init_completion || return
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--debug --exported --novolumegroup --help
- --ignorelockingfailure --partial --short --uuid --verbose
- --version' -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") )
fi
} &&
complete -F _pvscan pvscan
@@ -201,9 +199,7 @@ _pvmove()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--abort --autobackup --background --debug
- --force --help --interval --test --verbose --version --name' \
- -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") )
else
_lvm_physicalvolumes
fi
@@ -294,10 +290,7 @@ _vgchange()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--autobackup --alloc --partial --debug
- --help --ignorelockingfailure --test --uuid --verbose --version
- --available --resizeable --logicalvolume --addtag --deltag' \
- -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") )
else
_lvm_volumegroups
fi
@@ -325,9 +318,7 @@ _vgcreate()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--autobackup --addtag --alloc --debug --help
- --maxlogicalvolumes --metadatatype --maxphysicalvolumes
- --physicalextentsize --test --verbose --version' -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") )
else
local args
_lvm_count_args '@(-A|--autobackup|-M|--metadatatype|-s|--physicalextentsize)'
@@ -569,8 +560,7 @@ _vgsplit()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--autobackup --debug --help --list
- --metadatatype --test --verbose --version' -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") )
else
local args
_lvm_count_args '@(-A|--autobackup|-M|--metadatatype)'
diff --git a/completions/lz4 b/completions/lz4
index db8198f8..76c24bfa 100644
--- a/completions/lz4
+++ b/completions/lz4
@@ -13,9 +13,8 @@ _lz4()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W \
- '$(_parse_help "$1" -h | command sed -e "/#/d") -B{4..7} -i{1..9}' \
- -- "$cur") )
+ COMPREPLY=( $(compgen -X '-*#*' -W \
+ '$(_parse_help "$1" -h) -B{4..7} -i{1..9}' -- "$cur") )
return
fi
diff --git a/completions/makepkg b/completions/makepkg
index 98edda8f..71d4f76d 100644
--- a/completions/makepkg
+++ b/completions/makepkg
@@ -15,7 +15,8 @@ _makepkg_slackware()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W \
- '$1 | command sed -e "s/^options://" | _parse_help -' -- "$cur") )
+ '$($1 | command sed -e "s/^options://" | _parse_help -)' \
+ -- "$cur") )
return
fi
diff --git a/completions/man b/completions/man
index 02bd4f70..e5a47361 100644
--- a/completions/man
+++ b/completions/man
@@ -40,7 +40,8 @@ _man()
$split && return
if [[ $cur == -* ]]; then
- COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") )
+ local opts=$(_parse_help "$1" -h)
+ COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
diff --git a/completions/op b/completions/op
index b99bd2de..ddbe4c73 100644
--- a/completions/op
+++ b/completions/op
@@ -2,7 +2,7 @@
_op_commands()
{
- "$@" --help |
+ "$@" --help 2>/dev/null |
awk "/^(Available |Sub)commands/{flag=1;next}/^ /&&flag{print \$1}"
}
diff --git a/completions/perl b/completions/perl
index 98ddb9eb..bf117970 100644
--- a/completions/perl
+++ b/completions/perl
@@ -27,48 +27,63 @@ _perl()
optPrefix=-P$prev
optSuffix=-S/
prefix=$prev
- fi
- case $prev in
- -*[DeEiFl])
- return
- ;;
- -*[Ix])
- local IFS=$'\n'
- compopt -o filenames
- COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") )
- return
- ;;
- -*[mM])
- temp="${cur#-}"
- prefix+="${cur%$temp}"
- cur="$temp"
- _perl_helper modules $1
- return
- ;;
- -*V)
- if [[ $cur == :* ]]; then
- temp="${cur##+(:)}"
- prefix+="${cur%$temp}"
+ case $prev in
+ -*[DeEiFl])
+ return
+ ;;
+ -*[Ix])
local IFS=$'\n'
- COMPREPLY=( $(compgen -P "$prefix" -W \
- '$($1 -MConfig -e "print join \"\\n\",
- keys %Config::Config" 2>/dev/null)' -- "$temp") )
- __ltrim_colon_completions "$prefix$temp"
- fi
- return
- ;;
- -*d|-*dt)
- if [[ $cur == :* ]]; then
- temp="${cur#:}"
- prefix="$prefix${cur%$temp}"
- cur="Devel::$temp"
+ compopt -o filenames
+ COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") )
+ return
+ ;;
+ -*[mM])
+ temp="${cur#-}"
+ prefix+="${cur%$temp}"
+ cur="$temp"
_perl_helper modules $1
- fi
- ;;
- esac
+ return
+ ;;
+ -*V)
+ if [[ $cur == :* ]]; then
+ temp="${cur##+(:)}"
+ prefix+="${cur%$temp}"
+ local IFS=$'\n'
+ COMPREPLY=( $(compgen -P "$prefix" -W \
+ '$($1 -MConfig -e "print join \"\\n\",
+ keys %Config::Config" 2>/dev/null)' -- "$temp") )
+ __ltrim_colon_completions "$prefix$temp"
+ fi
+ return
+ ;;
+ -*d|-*dt)
+ if [[ $cur == :* ]]; then
+ temp="${cur#:}"
+ prefix="$prefix${cur%$temp}"
+ cur="Devel::$temp"
+ _perl_helper modules $1
+ fi
+ ;;
+ esac
- if [[ "$cur" == -* ]]; then
+ # Unlike other perl options, having a space between the `-e' and
+ # `-E' options and their arguments, e.g. `perl -e "exit 2"', is
+ # valid syntax. However, the argument is neither a filename nor a
+ # directory, but one line of perl program, thus do not suggest
+ # _filedir completion.
+ elif [[ "$prev" == -e ]] || [[ "$prev" == -E ]]; then
+ return
+
+ # Likewise, `-I' also accepts a space between option and argument
+ # and it takes a directory as value.
+ elif [[ "$prev" == -I ]]; then
+ local IFS=$'\n'
+ compopt -o filenames
+ COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") )
+ return
+
+ elif [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p
-n -a -F -l -0 -I -m -M -P -S -x -i -e' -- "$cur") )
else
diff --git a/completions/perltidy b/completions/perltidy
index ce93b2a5..91bd5094 100644
--- a/completions/perltidy
+++ b/completions/perltidy
@@ -47,7 +47,7 @@ _perltidy()
COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
else
- _filedir 'p[lm]'
+ _filedir 'p[lm]|t'
fi
} &&
complete -F _perltidy perltidy
diff --git a/completions/pgrep b/completions/pgrep
index e45d7d7f..1c507a42 100644
--- a/completions/pgrep
+++ b/completions/pgrep
@@ -36,7 +36,7 @@ _pgrep()
esac
if [[ $cur == -* ]]; then
- local help='$(_parse_help "$1")'
+ local help=$(_parse_help "$1")
[[ $help ]] || help='$("$1" --usage 2>&1 |
command sed -e "s/\[-signal\]//" -e "s/\[-SIGNAL\]//" |
_parse_usage -)'
diff --git a/completions/pkg-get b/completions/pkg-get
index ea300b8b..2f251338 100644
--- a/completions/pkg-get
+++ b/completions/pkg-get
@@ -36,7 +36,7 @@ _pkg_get()
return 1
fi
- i=${#COMP_WORDS[*]}
+ local i=${#COMP_WORDS[*]}
while [[ $i -gt 0 ]]; do
if [[ "${COMP_WORDS[--i]}" == -s ]]; then
url="${COMP_WORDS[$((i+1))]}"
diff --git a/completions/pkg_delete b/completions/pkg_delete
index b1a93c20..942647d0 100644
--- a/completions/pkg_delete
+++ b/completions/pkg_delete
@@ -1,6 +1,4 @@
-# bash completion for FreeBSD package management tools -*- shell-script -*-
-
-[[ $OSTYPE == *freebsd* ]] || return 1
+# bash completion for *BSD package management tools -*- shell-script -*-
_pkg_delete()
{
diff --git a/completions/pkgutil b/completions/pkgutil
index bafb9aab..febc2135 100644
--- a/completions/pkgutil
+++ b/completions/pkgutil
@@ -21,7 +21,7 @@ _pkgutil()
declare -a configuration_files=("/opt/csw/etc/pkgutil.conf" "/etc/opt/csw/pkgutil.conf")
declare -a catalog_files=()
- i=$cword
+ local i=$cword
while [[ $((i--)) -gt 1 ]]; do
if [[ "${words[$i]}" == -@(t|-temp) ]]; then
local url="${words[$((i+1))]}"
diff --git a/completions/postfix b/completions/postfix
index 89ff4dd4..eda9ad46 100644
--- a/completions/postfix
+++ b/completions/postfix
@@ -17,6 +17,8 @@ _postfix()
esac
if [[ $cur == -* ]]; then
+ # TODO: doesn't seem to work; the usage message doesn't get output
+ # if we try to grep it, it's only output on the console?
COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") )
return
fi
diff --git a/completions/pwck b/completions/pwck
index 7723f66d..cc5f2e42 100644
--- a/completions/pwck
+++ b/completions/pwck
@@ -6,7 +6,8 @@ _pwck()
_init_completion || return
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") )
+ local opts=$(_parse_help "$1")
+ COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") )
return
fi
diff --git a/completions/ri b/completions/ri
index 8f331419..7d1e7cf9 100644
--- a/completions/ri
+++ b/completions/ri
@@ -23,7 +23,7 @@ _ri_get_methods()
# older versions of ri didn't distinguish between class/module and
# instance methods
COMPREPLY+=( \
- "$(ruby -W0 $ri_path "${classes[@]}" | ruby -ane \
+ "$(ruby -W0 $ri_path "${classes[@]}" 2>/dev/null | ruby -ane \
'if /^-/.../^-/ and ! /^-/ and ! /^ +(class|module): / then \
print $_.split(/, |,$| +/).grep(/^[^\[]*$/).join("\n"); \
end' | sort -u)" )
diff --git a/completions/screen b/completions/screen
index 3b9fb272..17642863 100644
--- a/completions/screen
+++ b/completions/screen
@@ -25,6 +25,34 @@ _screen()
local cur prev words cword
_init_completion || return
+ if ((cword == 1)); then
+ if [[ $cur == /dev* ]]; then
+ COMPREPLY=( $(compgen -W "$(shopt -s nullglob; printf '%s\n' \
+ /dev/serial/by-id/* /dev/ttyUSB* /dev/ttyACM* 2>/dev/null)" \
+ -- "$cur") )
+ return
+ fi
+ if [[ $cur == //* ]]; then
+ COMPREPLY=( $(compgen -W '//telnet' -- "$cur") )
+ return
+ fi
+ fi
+
+ case ${words[1]} in
+ /dev*)
+ if ((cword == 2)); then
+ COMPREPLY=( $(compgen -W '110 300 600 1200 2400 4800 9600 \
+ 14400 19200 38400 57600 115200 128000 256000' -- "$cur") )
+ # TODO more, comma separated options
+ fi
+ return
+ ;;
+ //telnet)
+ ((cword == 2)) && _known_hosts_real -- "$cur"
+ return
+ ;;
+ esac
+
if ((cword > 2)); then
case ${words[cword-2]} in
-*[dD])
@@ -84,9 +112,7 @@ _screen()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln -list
- -L -m -O -p -q -r -R -s -S -t -T -U -v -wipe -x -X --help
- --version' -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
fi
} &&
complete -F _screen screen
diff --git a/completions/shellcheck b/completions/shellcheck
index 197c1811..4a40c8f9 100644
--- a/completions/shellcheck
+++ b/completions/shellcheck
@@ -16,7 +16,7 @@ _shellcheck()
--version|-!(-*)V*)
return
;;
- --exclude|-!(-*)e)
+ --exclude|--include|-!(-*)[ei])
return
;;
--format|-!(-*)f)
@@ -34,6 +34,18 @@ _shellcheck()
_shellcheck_optarg "$1" --shell
return
;;
+ --enable|-!(-*)o)
+ COMPREPLY=( $(compgen -W 'all' -- "$cur") ) # TODO others?
+ return
+ ;;
+ --source-path|-!(-*)P)
+ _filedir -d
+ COMPREPLY+=( $(compgen -W 'SCRIPTDIR' -- "$cur") )
+ return
+ ;;
+ --wiki-link-count|-!(-*)W)
+ return
+ ;;
esac
$split && return
diff --git a/completions/smartctl b/completions/smartctl
index c34ca598..ecef0b99 100644
--- a/completions/smartctl
+++ b/completions/smartctl
@@ -151,12 +151,7 @@ _smartctl()
$split && return
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--help --version --info --all --xall
- --scan --scan-open --quietmode= --device= --tolerance= --badsum=
- --report= --nocheck= --smart= --offlineauto= --saveauto= --health
- --capabilities --attributes --log= --vendorattribute=
- --firmwarebug= --presets= --drivedb= --test= --captive --abort' \
- -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
else
cur=${cur:=/dev/}
diff --git a/completions/ssh b/completions/ssh
index aaa10346..ecbd5896 100644
--- a/completions/ssh
+++ b/completions/ssh
@@ -3,7 +3,7 @@
_ssh_queries()
{
COMPREPLY+=( $(compgen -W \
- "cipher cipher-auth mac kex key key-cert key-plain protocol-version" \
+ "cipher cipher-auth mac kex key key-cert key-plain protocol-version sig" \
-- "$cur") )
}
@@ -34,7 +34,7 @@ _ssh_options()
local opts=(
AddKeysToAgent AddressFamily BatchMode BindAddress CanonicalDomains
CanonicalizeFallbackLocal CanonicalizeHostname CanonicalizeMaxDots
- CanonicalizePermittedCNAMEs CertificateFile
+ CanonicalizePermittedCNAMEs CASignatureAlgorithms CertificateFile
ChallengeResponseAuthentication CheckHostIP Ciphers ClearAllForwardings
Compression ConnectionAttempts ConnectTimeout ControlMaster ControlPath
ControlPersist DynamicForward EnableSSHKeysign EscapeChar
@@ -90,10 +90,10 @@ _ssh_suboption()
gssapidelegatecredentials|gssapirenewalforcesrekey|gssapitrustdns|\
hashknownhosts|hostbasedauthentication|identitiesonly|\
kbdinteractiveauthentication|kbdinteractivedevices|\
- nohostauthenticationforlocalhost|passwordauthentication|\
+ nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|\
proxyusefdpass|pubkeyauthentication|rhostsrsaauthentication|\
- rsaauthentication|stricthostkeychecking|streamlocalbindunlink|\
- tcpkeepalive|useprivilegedport|verifyhostkeydns|visualhostkey)
+ rsaauthentication|streamlocalbindunlink|\
+ tcpkeepalive|useprivilegedport|visualhostkey)
COMPREPLY=( $(compgen -W 'yes no' -- "$cur") )
;;
addkeystoagent)
@@ -108,15 +108,24 @@ _ssh_suboption()
canonicalizehostname)
COMPREPLY=( $(compgen -W 'yes no always' -- "$cur") )
;;
- *file|identityagent|include)
+ identityfile)
+ _ssh_identityfile
+ ;;
+ *file|identityagent|include|controlpath|revokedhostkeys|xauthlocation)
_filedir
;;
+ casignaturealgorithms)
+ COMPREPLY=( $(compgen -W '$(_ssh_query "$2" sig)' -- "$cur") )
+ ;;
cipher)
COMPREPLY=( $(compgen -W 'blowfish des 3des' -- "$cur") )
;;
ciphers)
_ssh_ciphers "$2"
;;
+ controlmaster)
+ COMPREPLY=( $(compgen -W 'yes ask auto autoask no' -- "$cur") )
+ ;;
compressionlevel)
COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") )
;;
@@ -133,9 +142,15 @@ _ssh_suboption()
kexalgorithms)
COMPREPLY=( $(compgen -W '$(_ssh_query "$2" kex)' -- "$cur") )
;;
+ loglevel)
+ COMPREPLY=( $(compgen -W 'QUIET FATAL ERROR INFO VERBOSE DEBUG{,1,2,3}' -- "$cur") )
+ ;;
macs)
_ssh_macs "$2"
;;
+ pkcs11provider)
+ _filedir so
+ ;;
preferredauthentications)
COMPREPLY=( $(compgen -W 'gssapi-with-mic host-based publickey
keyboard-interactive password' -- "$cur") )
@@ -150,12 +165,18 @@ _ssh_suboption()
proxyjump)
_known_hosts_real -a -F "$configfile" -- "$cur"
;;
+ proxycommand|remotecommand|localcommand)
+ COMPREPLY=( $(compgen -c -- "$cur") )
+ ;;
pubkeyacceptedkeytypes)
COMPREPLY=( $(compgen -W '$(_ssh_query "$2" key)' -- "$cur") )
;;
requesttty)
COMPREPLY=( $(compgen -W 'no yes force auto' -- "$cur") )
;;
+ stricthostkeychecking)
+ COMPREPLY=( $(compgen -W 'accept-new ask no off' -- "$cur") )
+ ;;
syslogfacility)
COMPREPLY=( $(compgen -W 'DAEMON USER AUTH LOCAL{0..7}' -- "$cur") )
;;
@@ -163,7 +184,7 @@ _ssh_suboption()
COMPREPLY=( $(compgen -W 'yes no point-to-point ethernet' \
-- "$cur") )
;;
- updatehostkeys)
+ updatehostkeys|verifyhostkeydns)
COMPREPLY=( $(compgen -W 'yes no ask' -- "$cur") )
;;
esac
@@ -202,6 +223,17 @@ _ssh_configfile()
done
}
+# With $1 set, look for public key files, else private
+_ssh_identityfile()
+{
+ [[ -z $cur && -d ~/.ssh ]] && cur=~/.ssh/id
+ _filedir
+ if (( ${#COMPREPLY[@]} > 0 )); then
+ COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' \
+ -X "${1:+!}*.pub" -- "$cur") )
+ fi
+}
+
_ssh()
{
local cur prev words cword
@@ -234,10 +266,14 @@ _ssh()
-*[DeLpRW])
return
;;
- -*[EFiS])
+ -*[EFS])
_filedir
return
;;
+ -*i)
+ _ssh_identityfile
+ return
+ ;;
-*I)
_filedir so
return
@@ -255,7 +291,7 @@ _ssh()
return
;;
-*O)
- COMPREPLY=( $(compgen -W 'check forward exit stop' -- "$cur") )
+ COMPREPLY=( $(compgen -W 'check forward cancel exit stop' -- "$cur") )
return
;;
-*o)
@@ -317,14 +353,22 @@ _sftp()
-*[BDlPRs])
return
;;
- -*[bFi])
+ -*[bF])
_filedir
return
;;
+ -*i)
+ _ssh_identityfile
+ return
+ ;;
-*c)
_ssh_ciphers
return
;;
+ -*J)
+ _known_hosts_real -a -F "$configfile" -- "$cur"
+ return
+ ;;
-*o)
_ssh_options
return
@@ -442,11 +486,20 @@ _scp()
COMPREPLY=( "${COMPREPLY[@]/%/ }" )
return
;;
- -*[Fi])
+ -*F)
_filedir
compopt +o nospace
return
;;
+ -*i)
+ _ssh_identityfile
+ compopt +o nospace
+ return
+ ;;
+ -*J)
+ _known_hosts_real -a -F "$configfile" -- "$cur"
+ return
+ ;;
-*[lP])
return
;;
diff --git a/completions/ssh-add b/completions/ssh-add
index d9157893..f35c7d00 100644
--- a/completions/ssh-add
+++ b/completions/ssh-add
@@ -6,7 +6,15 @@ _ssh_add()
_init_completion || return
case $prev in
- -*[tE])
+ -*E)
+ COMPREPLY=( $(compgen -W 'md5 sha256' -- "$cur") )
+ return
+ ;;
+ -*t)
+ return
+ ;;
+ -*T)
+ _filedir
return
;;
-*[se])
diff --git a/completions/ssh-copy-id b/completions/ssh-copy-id
index cb4cf920..ebfc46e6 100644
--- a/completions/ssh-copy-id
+++ b/completions/ssh-copy-id
@@ -9,7 +9,7 @@ _ssh_copy_id()
case $prev in
-i)
- _filedir pub
+ _xfunc ssh _ssh_identityfile pub
return
;;
-p)
diff --git a/completions/ssh-keygen b/completions/ssh-keygen
index 5c449fc0..36fa2cad 100644
--- a/completions/ssh-keygen
+++ b/completions/ssh-keygen
@@ -42,7 +42,12 @@ _ssh_keygen()
return
;;
-*t)
- COMPREPLY=( $(compgen -W 'dsa ecdsa ed25519 rsa rsa1' -- "$cur") )
+ local protocols=$(_xfunc ssh _ssh_query "$1" protocol-version)
+ local types='dsa ecdsa ed25519 rsa'
+ if [[ $protocols == *1* ]]; then
+ types+=' rsa1'
+ fi
+ COMPREPLY=( $(compgen -W "$types" -- "$cur") )
return
;;
esac
diff --git a/completions/sysctl b/completions/sysctl
index e683977b..6eb3f391 100644
--- a/completions/sysctl
+++ b/completions/sysctl
@@ -22,7 +22,7 @@ _sysctl()
local suffix=
[[ $prev == -w ]] && suffix="="
COMPREPLY=( $(compgen -S "$suffix" -W \
- "$(PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null)" -- "$cur") )
+ "$(PATH="$PATH:/sbin" $1 -N -a 2>/dev/null)" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
fi
} &&
diff --git a/completions/tar b/completions/tar
index 2ed98e78..fda739c4 100644
--- a/completions/tar
+++ b/completions/tar
@@ -398,7 +398,7 @@ __tar_extract_like_mode()
__tar_try_list_archive()
{
- local tarball tarbin untar
+ local tarball tarbin untar i
__tar_extract_like_mode || return 1
@@ -410,14 +410,19 @@ __tar_try_list_archive()
untar="tf"
shift
- read tarball <<<"$(printf -- '%s\n' "$@" \
- | command sed -n "/^.\{1,\}$regex\$/p")"
+ for i in "$@"; do
+ if [[ $i == *.$ext ]]; then
+ tarball=$i
+ break
+ fi
+ done
if [[ -n "$tarball" ]]; then
local IFS=$'\n'
COMPREPLY=($(compgen -o filenames -W "$(
+ $tarbin $untar "$tarball" 2>/dev/null |
while read line; do
printf "%q\n" "$(printf %q"\n" "$line")"
- done <<<"$($tarbin $untar "$tarball" 2>/dev/null)"
+ done
)" -- "$(printf "%q\n" "$cur")"))
return 0
fi
@@ -435,7 +440,6 @@ __tar_detect_ext()
{
local tars='@(@(tar|gem|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst))'
ext="$tars"
- regex='\(\(tar\|gem\|spkg\)\(\.\(Z\|[bgx]z\|bz2\|lz\(ma\|o\)\?\|zst\)\)\?\|t\([abglx]z\|bz\?2\|zst\)\)'
case "$tar_mode_arg" in
--*)
@@ -456,15 +460,12 @@ __tar_detect_ext()
;;
*[Zz]*f)
ext='@(@(t?(ar.)|gem.|spkg.)@(gz|Z)|taz)'
- regex='\(\(t\(ar\.\)\?\|gem\.\|spkg\.\)\(gz\|Z\)\|taz\)'
;;
*[jy]*f)
ext='@(@(t?(ar.)|gem.)bz?(2)|spkg|tb2)'
- regex='\(\(t\(ar\.\)\?\|gem\.\)bz2\?\|spkg\|tb2\)'
;;
*[J]*f)
ext='@(@(tar|gem|spkg).@(lzma|xz)|t[lx]z)'
- regex='\(\(tar\|gem\|spkg\)\.\(lzma\|xz\)\|t[lx]z\)'
;;
esac
}
@@ -499,7 +500,7 @@ _gtar()
__tar_preparse_cmdline "${words[@]}"
- local ext regex tar untar
+ local ext tar untar
__tar_detect_ext
@@ -674,7 +675,7 @@ _posix_tar()
__tar_preparse_cmdline "${words[@]}"
- local ext regex tar untar
+ local ext tar untar
__tar_detect_ext
diff --git a/completions/timeout b/completions/timeout
index b5851baa..bcc9a865 100644
--- a/completions/timeout
+++ b/completions/timeout
@@ -29,7 +29,8 @@ _timeout()
$split && return
if [[ $cur == -* ]]; then
- COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
+ local opts=$(_parse_help "$1")
+ COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
fi
} &&
diff --git a/completions/tipc b/completions/tipc
index d85f5e9c..830040d9 100644
--- a/completions/tipc
+++ b/completions/tipc
@@ -65,10 +65,9 @@ _tipc_link() {
# awk drops link state and last trailing :
local links=$(tipc link list 2>/dev/null | \
awk '{print substr($1, 0, length($1))}')
- if [[ $filter == "peers" ]]; then
- links=$(command sed '/broadcast-link/d' <<<"$links")
- fi
- COMPREPLY=( $(compgen -W '$links' -- $cur) )
+ local -a exclude
+ [[ $filter == peers ]] && exclude=( -X broadcast-link )
+ COMPREPLY=( $(compgen "${exclude[@]}" -W '$links' -- $cur) )
fi
}
diff --git a/completions/tox b/completions/tox
index a6418aca..7dcddc54 100644
--- a/completions/tox
+++ b/completions/tox
@@ -5,6 +5,12 @@ _tox()
local cur prev words cword
_init_completion || return
+ # Complete defaults following a "--"
+ if [[ "${words[*]:0:cword} " == *\ --\ * && $cur != -- ]]; then
+ compopt -o bashdefault -o default
+ return
+ fi
+
case $prev in
--help|--version|--num|--index-url|--hashseed|--force-dep|-!(-*)[hni])
return
@@ -20,15 +26,18 @@ _tox()
-!(-*)e)
local envs=$(
{ "$1" --listenvs-all || "$1" --listenvs; } 2>/dev/null )
+ [[ $envs ]] || envs=$(
+ command sed -e 's/,/ /g' -ne 's/^envlist[[:space:]]*=//p' \
+ tox.ini 2>/dev/null)
local prefix=""; [[ $cur == *,* ]] && prefix="${cur%,*},"
- COMPREPLY=( $(compgen -W "$envs ALL" -- "${cur##*,}") )
+ COMPREPLY=( $(compgen -X '*[{}]*' -W "$envs ALL" -- "${cur##*,}") )
[[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} )
return
;;
esac
if [[ $cur == -* ]]; then
- COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1") --' -- "$cur") )
return
fi
} &&
diff --git a/completions/unrar b/completions/unrar
index 5381876f..959a5c9c 100644
--- a/completions/unrar
+++ b/completions/unrar
@@ -13,7 +13,7 @@ _unrar()
if [[ $cword -eq 1 ]]; then
COMPREPLY=( $(compgen -W 'e l lb lt p t v vb vt x' -- "$cur") )
else
- _filedir rar
+ _filedir '@(rar|exe)'
fi
fi
diff --git a/completions/update-alternatives b/completions/update-alternatives
index e9ba476b..17b687a7 100644
--- a/completions/update-alternatives
+++ b/completions/update-alternatives
@@ -82,9 +82,7 @@ _update_alternatives()
_installed_alternatives
;;
*)
- COMPREPLY=( $(compgen -W '--verbose --quiet --help --version
- --altdir --admindir --install --remove --auto --display
- --config --set' -- "$cur") )
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
esac
} &&
complete -F _update_alternatives update-alternatives alternatives
diff --git a/completions/update-rc.d b/completions/update-rc.d
index 384b8dd4..31cd820b 100644
--- a/completions/update-rc.d
+++ b/completions/update-rc.d
@@ -7,7 +7,7 @@ _update_rc_d()
local cur prev words cword
_init_completion || return
- local sysvdir services options valid_options
+ local sysvdir services options
[[ -d /etc/rc.d/init.d ]] && sysvdir=/etc/rc.d/init.d \
|| sysvdir=/etc/init.d
@@ -17,13 +17,8 @@ _update_rc_d()
options=( -f -n )
if [[ $cword -eq 1 || "$prev" == -* ]]; then
- valid_options=( $(\
- tr " " "\n" <<<"${words[*]} ${options[*]}" \
- | command sed -ne "/$(command sed "s/ /\\|/g" <<<"${options[*]}")/p" \
- | sort | uniq -u \
- ) )
- COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \
- -X '$(tr " " "|" <<<${words[@]})' -- "$cur") )
+ COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \
+ -X '$(tr " " "|" <<<${words[@]})' -- "$cur") )
elif [[ "$prev" == ?($(tr " " "|" <<<"${services[*]}")) ]]; then
COMPREPLY=( $(compgen -W 'remove defaults start stop' -- "$cur") )
elif [[ "$prev" == defaults && "$cur" == [0-9] ]]; then
diff --git a/completions/valgrind b/completions/valgrind
index 2df09707..01ca62c5 100644
--- a/completions/valgrind
+++ b/completions/valgrind
@@ -32,7 +32,8 @@ _valgrind()
# Tools seem to be named e.g. like memcheck-amd64-linux from which
# we want to grab memcheck.
COMPREPLY=( $(compgen -W '$(
- for f in /usr{,/local}/lib{,64,exec}/valgrind/*; do
+ for f in /usr{,/local}/lib{,64,exec}{/*-linux-gnu,}/valgrind/*
+ do
[[ $f != *.so && -x $f && $f =~ ^.*/(.*)-[^-]+-[^-]+ ]] &&
printf "%s\n" "${BASH_REMATCH[1]}"
done)' -- "$cur") )
diff --git a/completions/wine b/completions/wine
index f871e744..dab45ae4 100644
--- a/completions/wine
+++ b/completions/wine
@@ -15,6 +15,6 @@ _wine()
_filedir
fi
} &&
-complete -F _wine wine
+complete -F _wine wine wine-development wine-stable
# ex: filetype=sh
diff --git a/completions/xsltproc b/completions/xsltproc
index 241de67b..dbe68c45 100644
--- a/completions/xsltproc
+++ b/completions/xsltproc
@@ -16,8 +16,8 @@ _xsltproc()
;;
--encoding)
# some aliases removed
- COMPREPLY=( $(compgen -W "$(iconv -l | command sed -e '/^UTF[1378]/d' \
- -e '/^ISO[0-9_]/d' -e '/^8859/d' -e 's/\/.*//')" -- "$cur") )
+ COMPREPLY=( $(compgen -X '@(UTF[1378]|8859|ISO[0-9_])*' \
+ -W "$(iconv -l | command sed -e 's/\/.*//')" -- "$cur") )
return
;;
--param|--stringparam)
diff --git a/completions/xvfb-run b/completions/xvfb-run
new file mode 100644
index 00000000..162c66ed
--- /dev/null
+++ b/completions/xvfb-run
@@ -0,0 +1,36 @@
+# bash completion for xvfb-run -*- shell-script -*-
+
+_xvfb_run()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ local i
+ for (( i=1; i <= COMP_CWORD; i++ )); do
+ if [[ ${COMP_WORDS[i]} != -* ]]; then
+ _command_offset $i
+ return
+ fi
+ [[ ${COMP_WORDS[i]} == -!(-*)[npsef] ]] && ((i++))
+ done
+
+ case $prev in
+ --help|--server-num|--xauth-protocol|--server-args|-!(-*)[hnps])
+ return
+ ;;
+ --error-file|--auth-file|-!(-*)[ef])
+ _filedir
+ return
+ ;;
+ esac
+
+ $split && return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ fi
+} &&
+complete -F _xvfb_run xvfb-run
+
+# ex: filetype=sh
diff --git a/configure.ac b/configure.ac
index 1f3b37e8..570c85a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,13 @@
AC_PREREQ([2.60])
-AC_INIT([bash-completion], [2.9])
+AC_INIT([bash-completion], [2.10])
AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip -Wall -Wno-portability -Werror])
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_SED
-AC_SUBST(compatdir, $sysconfdir/bash_completion.d)
+AC_ARG_WITH([pytest],[ --with-pytest=executable],[PYTEST="$withval"])
+if test -z "$PYTEST"; then
+ AC_CHECK_PROGS([PYTEST],[pytest pytest-3],[pytest])
+fi
AC_CONFIG_FILES([
Makefile
completions/Makefile
diff --git a/helpers/Makefile.am b/helpers/Makefile.am
index aef19b0c..2a0a18d7 100644
--- a/helpers/Makefile.am
+++ b/helpers/Makefile.am
@@ -1,4 +1,4 @@
-helpersdir = $(pkgdatadir)/helpers
+helpersdir = $(datadir)/$(PACKAGE)/helpers
helpers_DATA = perl python
EXTRA_DIST = $(helpers_DATA)
diff --git a/setup-symlinks.sh b/setup-symlinks.sh
new file mode 100755
index 00000000..71eb92d5
--- /dev/null
+++ b/setup-symlinks.sh
@@ -0,0 +1,9 @@
+#!/bin/sh -eu
+
+targetdir="$1"; shift
+target="$1"; shift
+
+for file in "$@"; do
+ rm -f "$targetdir/$file"
+ ln -s "$target" "$targetdir/$file"
+done
diff --git a/test/Makefile.am b/test/Makefile.am
index 454f1ecd..003ec132 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -8,6 +8,7 @@ EXTRA_DIST = completion \
config \
fixtures \
lib \
+ setup.cfg \
unit
all:
diff --git a/test/config/bashrc b/test/config/bashrc
index 69098e14..dad96335 100644
--- a/test/config/bashrc
+++ b/test/config/bashrc
@@ -1,38 +1,50 @@
-# bashrc file for DejaGnu testsuite
+# bashrc file for bash-completion test suite
# Note that we do some initialization that would be too late to do here in
-# library.exp's start_bash().
+# library.exp's start_bash() and conftest.py.
- # Use emacs key bindings
+# Use emacs key bindings
set -o emacs
- # Use bash strict mode
+
+# Use bash strict mode
set -o posix
- # Unset `command_not_found_handle' as defined on Debian/Ubuntu, because this
- # troubles and slows down testing
+
+# Unset `command_not_found_handle' as defined on Debian/Ubuntu, because this
+# troubles and slows down testing
unset -f command_not_found_handle
+
TESTDIR=$(pwd)
+
export PS2='> '
- # Also test completions of system administrator commands, which are
- # installed via the same PATH expansion in `bash_completion.have()'
+
+# Also test completions of system administrator commands, which are
+# installed via the same PATH expansion in `bash_completion.have()'
export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
- # ...as well as games on some systems not in PATH by default:
+
+# ...as well as games on some systems not in PATH by default:
export PATH=$PATH:/usr/games:/usr/local/games
- # For clean test state, avoid sourcing user's ~/.bash_completion
+
+# For clean test state, avoid sourcing user's ~/.bash_completion
export BASH_COMPLETION_USER_FILE=/dev/null
- # ...and avoid stuff in BASH_COMPLETION_USER_DIR overriding in-tree
- # completions. The user dir is first in the lookup path, so this should also
- # give precedence to the in-tree "completions" dir over other ones, e.g.
- # the one possibly in /usr/share/bash-completion.
+
+# ...and avoid stuff in BASH_COMPLETION_USER_DIR and system install locations
+# overriding in-tree completions. Setting the user dir would otherwise suffice,
+# but simple xspec completions are only installed if a separate one is not
+# found in any completion dirs. Therefore we also point the "system" dirs to
+# locations that should not yield valid completions and helpers paths either.
export BASH_COMPLETION_USER_DIR=$(cd "$SRCDIR/.."; pwd)
+# /var/empty isn't necessarily actually always empty :P
+export BASH_COMPLETION_COMPAT_DIR=/var/empty/bash_completion.d
+export XDG_DATA_DIRS=/var/empty
- # Make sure default settings are in effect
+# Make sure default settings are in effect
unset -v \
COMP_CONFIGURE_HINTS \
COMP_CVS_REMOTE \
COMP_KNOWN_HOSTS_WITH_HOSTFILE \
COMP_TAR_INTERNAL_PATHS
- # Load bash testsuite helper functions
+# Load bash testsuite helper functions
. $SRCDIR/lib/library.sh
# Local variables:
diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile
new file mode 100644
index 00000000..200f9182
--- /dev/null
+++ b/test/docker/Dockerfile
@@ -0,0 +1,6 @@
+ARG DIST
+FROM vskytta/bash-completion:$DIST
+
+WORKDIR /work
+COPY . .
+CMD ["test/docker/docker-script.sh"]
diff --git a/test/docker/Dockerfile-centos6 b/test/docker/Dockerfile-centos6
deleted file mode 100644
index 6f886ffa..00000000
--- a/test/docker/Dockerfile-centos6
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM vskytta/bash-completion:centos6
-
-# When adding new completions, install packages desired for their testing here
-# in case they're not in the base image, and remove later when the base image
-# has caught up.
-#RUN yum -y install \
-# some-package
-
-WORKDIR /work
-COPY . .
-CMD ["bash"]
diff --git a/test/docker/Dockerfile-fedoradev b/test/docker/Dockerfile-fedoradev
deleted file mode 100644
index 8c4f86d7..00000000
--- a/test/docker/Dockerfile-fedoradev
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM vskytta/bash-completion:fedoradev
-
-# When adding new completions, install packages desired for their testing here
-# in case they're not in the base image, and remove later when the base image
-# has caught up.
-#RUN dnf --nogpgcheck --refresh -y install \
-# some-package
-
-WORKDIR /work
-COPY . .
-CMD ["bash"]
diff --git a/test/docker/Dockerfile-tools b/test/docker/Dockerfile-tools
deleted file mode 100644
index 2328808e..00000000
--- a/test/docker/Dockerfile-tools
+++ /dev/null
@@ -1,3 +0,0 @@
-FROM vskytta/bash-completion:tools
-
-COPY . .
diff --git a/test/docker/Dockerfile-ubuntu14 b/test/docker/Dockerfile-ubuntu14
deleted file mode 100644
index a1086add..00000000
--- a/test/docker/Dockerfile-ubuntu14
+++ /dev/null
@@ -1,13 +0,0 @@
-FROM vskytta/bash-completion:ubuntu14
-
-# When adding new completions, install packages desired for their testing here
-# in case they're not in the base image, and remove later when the base image
-# has caught up.
-#RUN apt-get update \
-# && \
-# DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
-# some-package
-
-WORKDIR /work
-COPY . .
-CMD ["bash"]
diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh
index ec310b35..681f2429 100755
--- a/test/docker/docker-script.sh
+++ b/test/docker/docker-script.sh
@@ -20,15 +20,6 @@ if [ "$BSD" ]; then
export PATH
fi
-case $DIST in
- centos6|ubuntu14)
- : ${PYTEST:=/root/.local/bin/pytest}
- ;;
- *)
- : ${PYTEST:=pytest-3}
- ;;
-esac
-
export bashcomp_bash=bash
env
@@ -37,6 +28,5 @@ autoreconf -i
make -j
xvfb-run make distcheck \
- PYTEST=$PYTEST \
PYTESTFLAGS="--numprocesses=auto --dist=loadfile" \
RUNTESTFLAGS="--all --verbose"
diff --git a/test/fixtures/shared/.ssh/known_hosts b/test/fixtures/shared/.ssh/known_hosts
new file mode 100644
index 00000000..03d444ac
--- /dev/null
+++ b/test/fixtures/shared/.ssh/known_hosts
@@ -0,0 +1 @@
+bash-completion-canary-host.local
diff --git a/test/fixtures/tox/tox.ini b/test/fixtures/tox/tox.ini
new file mode 100644
index 00000000..a64454fc
--- /dev/null
+++ b/test/fixtures/tox/tox.ini
@@ -0,0 +1,6 @@
+[tox]
+envlist = py37
+
+[testenv]
+deps = pytest
+commands = pytest
diff --git a/test/lib/completions/finger.exp b/test/lib/completions/finger.exp
index fa9f5b6b..c055f354 100644
--- a/test/lib/completions/finger.exp
+++ b/test/lib/completions/finger.exp
@@ -14,13 +14,6 @@ setup
sync_after_int
-set test "Tab should complete partial username"
-assert_complete_partial [exec bash -c "compgen -A user -S @"] "finger" "" $test -nospace
-
-
-sync_after_int
-
-
set test "Tab should complete partial hostname"
# Build string list of hostnames, starting with the character of the first
# host, unless host starts with a COMP_WORDBREAKS character, e.g. a colon (:).
diff --git a/test/lib/library.exp b/test/lib/library.exp
index 899d74b6..c90c927c 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -378,37 +378,6 @@ proc assert_complete_dir {expected cmd dir {test ""} {args {}}} {
-# Make sure a partial argument is completed.
-# A completion is tried with `$partial', or if this is empty, the first
-# character of the first item of `$expected'. Only the items from $expected,
-# starting with this character are then expected as completions.
-# @param list $expected List of all completions.
-# @param string $cmd Command given to generate items
-# @param string $partial Word to complete
-# @param string $test Test title
-# @param list $args See: assert_complete()
-proc assert_complete_partial {expected cmd {partial ""} {test ""} {args {}}} {
- if {$test == ""} {set test "$cmd should complete partial argument"}
- if {[llength $expected] == 0} {
- unresolved "$test"
- } else {
- set pick {}
- # Make sure expected items are unique
- set expected [lsort -unique $expected]
- foreach item $expected {
- if {$partial == ""} {set partial [string range $item 0 0]}
- # Only append item if starting with $partial
- if {[string range $item 0 [expr [string length $partial] - 1]] == "$partial"} {
- lappend pick $item
- }
- }
- # NOTE: The `eval' is necessary to flatten the $args list
- # See also: http://wiki.tcl.tk/11787 - {expand}
- eval assert_complete \$pick \"\$cmd \$partial\" \$test $args; #"
- }
-}
-
-
# If cword contains colon (:), left-trim completions with cword
# @param string $cmd Command to complete
# @param list $items Reference to list of completions to trim
@@ -781,7 +750,6 @@ proc _save_env {{file ""}} {
# Source bash_completion package
proc source_bash_completion {} {
- assert_bash_exec {BASH_COMPLETION_COMPAT_DIR="$SRCDIR/fixtures/shared/empty_dir"}
assert_bash_exec {source $(cd "$SRCDIR/.."; pwd)/bash_completion}
}
diff --git a/test/requirements.txt b/test/requirements.txt
index 23ced801..70d77d02 100644
--- a/test/requirements.txt
+++ b/test/requirements.txt
@@ -1,5 +1,5 @@
-black>=19.3b0
+black>=19.10b0;python_version>"3.6"
pexpect>=4
-pytest>=3.5
+pytest>=3.6
pytest-xdist
typing;python_version<"3.5"
diff --git a/test/runLint b/test/runLint
index 8699d7a0..a84c46d8 100755
--- a/test/runLint
+++ b/test/runLint
@@ -32,7 +32,7 @@ gitgrep $cmdstart'sed\b.*\\\|' \
#gitgrep $cmdstart'sed\b.*;' \
# 'sed with ;, use multiple -e options instead (POSIX?) (false positives?)'
-gitgrep $cmdstart'sed\b.*-[^[:space:]]*[rE]' \
+gitgrep $cmdstart'sed\b.*[[:space:]]-[^[:space:]]*[rE]' \
'sed with -r or -E, drop and use POSIX BRE instead'
gitgrep $cmdstart'[ef]grep\b' \
diff --git a/test/setup.cfg b/test/setup.cfg
new file mode 100644
index 00000000..ef9c755e
--- /dev/null
+++ b/test/setup.cfg
@@ -0,0 +1,9 @@
+[tool:pytest]
+minversion = 3.6
+markers =
+ bashcomp
+ complete
+
+[mypy]
+python_version = 3.4
+ignore_missing_imports = true
diff --git a/test/t/Makefile.am b/test/t/Makefile.am
index fb7665f1..0ce46b12 100644
--- a/test/t/Makefile.am
+++ b/test/t/Makefile.am
@@ -34,6 +34,7 @@ EXTRA_DIST = \
test_autoreconf.py \
test_autorpm.py \
test_autoscan.py \
+ test_autossh.py \
test_autoupdate.py \
test_avctrl.py \
test_awk.py \
@@ -53,6 +54,7 @@ EXTRA_DIST = \
test_cal.py \
test_cancel.py \
test_cardctl.py \
+ test_carton.py \
test_cat.py \
test_cc.py \
test_ccache.py \
@@ -86,7 +88,9 @@ EXTRA_DIST = \
test_clisp.py \
test_clone_member.py \
test_co.py \
+ test_colordiff.py \
test_compare.py \
+ test_compgen.py \
test_complete.py \
test_composite.py \
test_config_list.py \
@@ -122,6 +126,7 @@ EXTRA_DIST = \
test_dir.py \
test_display.py \
test_dmesg.py \
+ test_dmypy.py \
test_dnssec_keygen.py \
test_dnsspoof.py \
test_dot.py \
@@ -207,6 +212,7 @@ EXTRA_DIST = \
test_growisofs.py \
test_grpck.py \
test_grub.py \
+ test_gssdp_discover.py \
test_gzip.py \
test_hciattach.py \
test_hciconfig.py \
@@ -232,6 +238,7 @@ EXTRA_DIST = \
test_iftop.py \
test_ifup.py \
test_import.py \
+ test_influx.py \
test_info.py \
test_inject.py \
test_inotifywait.py \
@@ -560,6 +567,7 @@ EXTRA_DIST = \
test_strip.py \
test_su.py \
test_sudo.py \
+ test_sum.py \
test_svcadm.py \
test_svk.py \
test_svn.py \
@@ -658,6 +666,7 @@ EXTRA_DIST = \
test_xrandr.py \
test_xrdb.py \
test_xsltproc.py \
+ test_xvfb_run.py \
test_xvnc4viewer.py \
test_xxd.py \
test_xz.py \
@@ -671,7 +680,7 @@ EXTRA_DIST = \
all:
-PYTEST = pytest
+PYTEST = @PYTEST@
check-local:
$(PYTEST) $(PYTESTFLAGS) $(srcdir)
diff --git a/test/t/conftest.py b/test/t/conftest.py
index 0969a313..20942e87 100644
--- a/test/t/conftest.py
+++ b/test/t/conftest.py
@@ -2,6 +2,7 @@ import difflib
import os
import re
import shlex
+import subprocess
from typing import Iterable, List, Optional, Tuple, Union
import pexpect
@@ -81,7 +82,7 @@ def bash(request) -> pexpect.spawn:
logfile = None
if os.environ.get("BASHCOMP_TEST_LOGFILE"):
- logfile = open(os.environ.get("BASHCOMP_TEST_LOGFILE"), "w")
+ logfile = open(os.environ["BASHCOMP_TEST_LOGFILE"], "w")
testdir = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.pardir)
)
@@ -93,8 +94,6 @@ def bash(request) -> pexpect.spawn:
PS1=PS1,
INPUTRC="%s/config/inputrc" % testdir,
TERM="dumb",
- BASH_COMPLETION_COMPAT_DIR="%s/fixtures/shared/empty_dir"
- % testdir,
LC_COLLATE="C", # to match Python's default locale unaware sort
)
)
@@ -123,7 +122,7 @@ def bash(request) -> pexpect.spawn:
assert_bash_exec(bash, "source '%s/../bash_completion'" % testdir)
# Use command name from marker if set, or grab from test filename
- cmd = None
+ cmd = None # type: Optional[str]
cmd_found = False
marker = request.node.get_closest_marker("bashcomp")
if marker:
@@ -132,7 +131,7 @@ def bash(request) -> pexpect.spawn:
# Run pre-test commands, early so they're usable in skipif
for pre_cmd in marker.kwargs.get("pre_cmds", []):
assert_bash_exec(bash, pre_cmd)
- # Process skip conditions
+ # Process skip and xfail conditions
skipif = marker.kwargs.get("skipif")
if skipif:
try:
@@ -142,7 +141,14 @@ def bash(request) -> pexpect.spawn:
else:
bash.close()
pytest.skip(skipif)
- return
+ xfail = marker.kwargs.get("xfail")
+ if xfail:
+ try:
+ assert_bash_exec(bash, xfail)
+ except AssertionError:
+ pass
+ else:
+ pytest.xfail(xfail)
if not cmd_found:
match = re.search(
r"^test_(.+)\.py$", os.path.basename(str(request.fspath))
@@ -150,6 +156,8 @@ def bash(request) -> pexpect.spawn:
if match:
cmd = match.group(1)
+ request.cls.cmd = cmd
+
if (cmd_found and cmd is None) or is_testable(bash, cmd):
before_env = get_env(bash)
yield bash
@@ -178,16 +186,14 @@ def is_testable(bash: pexpect.spawn, cmd: str) -> bool:
if not cmd:
pytest.fail("Could not resolve name of command to test")
return False
- if not is_bash_type(bash, cmd):
- pytest.skip("Command %s not found" % cmd)
- return False
if not load_completion_for(bash, cmd):
pytest.skip("No completion for command %s" % cmd)
- return False
return True
-def is_bash_type(bash: pexpect.spawn, cmd: str) -> bool:
+def is_bash_type(bash: pexpect.spawn, cmd: Optional[str]) -> bool:
+ if not cmd:
+ return False
typecmd = "type %s &>/dev/null && echo -n 0 || echo -n 1" % cmd
bash.sendline(typecmd)
bash.expect_exact(typecmd + "\r\n")
@@ -208,7 +214,7 @@ def load_completion_for(bash: pexpect.spawn, cmd: str) -> bool:
def assert_bash_exec(
- bash: pexpect.spawn, cmd: str, want_output: bool = False
+ bash: pexpect.spawn, cmd: str, want_output: bool = False, want_newline=True
) -> str:
# Send command
@@ -216,7 +222,7 @@ def assert_bash_exec(
bash.expect_exact(cmd)
# Find prompt, output is before it
- bash.expect_exact("\r\n" + PS1)
+ bash.expect_exact("%s%s" % ("\r\n" if want_newline else "", PS1))
output = bash.before
# Retrieve exit status
@@ -318,7 +324,7 @@ class CompletionResult:
Defining __eq__ this way is quite ugly, but facilitates concise
testing code.
"""
- expiter = [expected] if isinstance(expected, str) else sorted(expected)
+ expiter = [expected] if isinstance(expected, str) else expected
if self._items is not None:
return self._items == expiter
return bool(
@@ -370,7 +376,14 @@ def assert_complete(
pass
else:
pytest.skip(skipif)
- return CompletionResult("", [])
+ xfail = kwargs.get("xfail")
+ if xfail:
+ try:
+ assert_bash_exec(bash, xfail)
+ except AssertionError:
+ pass
+ else:
+ pytest.xfail(xfail)
cwd = kwargs.get("cwd")
if cwd:
assert_bash_exec(bash, "cd '%s'" % cwd)
@@ -441,11 +454,45 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult:
return CompletionResult("", [])
for pre_cmd in marker.kwargs.get("pre_cmds", []):
assert_bash_exec(bash, pre_cmd)
+ cmd = getattr(request.cls, "cmd", None)
+ if marker.kwargs.get("require_longopt"):
+ # longopt completions require both command presence and that it
+ # responds something useful to --help
+ if "require_cmd" not in marker.kwargs:
+ marker.kwargs["require_cmd"] = True
+ if "xfail" not in marker.kwargs:
+ marker.kwargs["xfail"] = (
+ "! %s --help &>/dev/null || "
+ "! %s --help 2>&1 | command grep -qF -- --help"
+ ) % ((cmd,) * 2)
+ if marker.kwargs.get("require_cmd") and not is_bash_type(bash, cmd):
+ pytest.skip("Command not found")
return assert_complete(bash, marker.args[0], **marker.kwargs)
-def in_docker() -> bool:
- return os.path.exists("/.dockerenv")
+def in_container() -> bool:
+ try:
+ container = subprocess.check_output(
+ "virt-what || systemd-detect-virt --container",
+ stderr=subprocess.DEVNULL,
+ shell=True,
+ ).strip()
+ except subprocess.CalledProcessError:
+ container = b""
+ if container and container != b"none":
+ return True
+ if os.path.exists("/.dockerenv"):
+ return True
+ try:
+ with open("/proc/1/environ", "rb") as f:
+ # LXC, others?
+ if any(
+ x.startswith(b"container=") for x in f.readline().split(b"\0")
+ ):
+ return True
+ except OSError:
+ pass
+ return False
class TestUnitBase:
diff --git a/test/t/test_2to3.py b/test/t/test_2to3.py
index 966ed1f5..030fb261 100644
--- a/test/t/test_2to3.py
+++ b/test/t/test_2to3.py
@@ -5,3 +5,7 @@ class Test2to3:
@pytest.mark.complete("2to3 ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("2to3 -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_7z.py b/test/t/test_7z.py
index 7d68c7b2..c6e73890 100644
--- a/test/t/test_7z.py
+++ b/test/t/test_7z.py
@@ -20,7 +20,7 @@ class Test7z:
def test_4(self, completion):
assert completion == "a.7z"
- @pytest.mark.complete("7z d a.7z ", cwd="7z")
+ @pytest.mark.complete("7z d a.7z ", cwd="7z", require_cmd=True)
def test_5(self, completion):
assert completion == "abc"
diff --git a/test/t/test_a2ps.py b/test/t/test_a2ps.py
index 9d885461..38365f03 100644
--- a/test/t/test_a2ps.py
+++ b/test/t/test_a2ps.py
@@ -5,3 +5,7 @@ class TestA2ps:
@pytest.mark.complete("a2ps ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("a2ps -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_a2x.py b/test/t/test_a2x.py
index 3741e28d..4bfb4283 100644
--- a/test/t/test_a2x.py
+++ b/test/t/test_a2x.py
@@ -5,3 +5,7 @@ class TestA2x:
@pytest.mark.complete("a2x ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("a2x -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_abook.py b/test/t/test_abook.py
index 1df910cf..9542a4c9 100644
--- a/test/t/test_abook.py
+++ b/test/t/test_abook.py
@@ -2,6 +2,6 @@ import pytest
class TestAbook:
- @pytest.mark.complete("abook -")
+ @pytest.mark.complete("abook -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_aclocal.py b/test/t/test_aclocal.py
index cb3aca1b..ad28b42b 100644
--- a/test/t/test_aclocal.py
+++ b/test/t/test_aclocal.py
@@ -5,3 +5,7 @@ class TestAclocal:
@pytest.mark.complete("aclocal ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("aclocal -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_acpi.py b/test/t/test_acpi.py
index 8da4eaf4..bd06d938 100644
--- a/test/t/test_acpi.py
+++ b/test/t/test_acpi.py
@@ -2,6 +2,6 @@ import pytest
class TestAcpi:
- @pytest.mark.complete("acpi -")
+ @pytest.mark.complete("acpi -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_acroread.py b/test/t/test_acroread.py
index 471b93c2..22d60240 100644
--- a/test/t/test_acroread.py
+++ b/test/t/test_acroread.py
@@ -2,6 +2,6 @@ import pytest
class TestAcroread:
- @pytest.mark.complete("acroread ", cwd="fixtures/acroread")
+ @pytest.mark.complete("acroread ", cwd="acroread")
def test_1(self, completion):
assert completion == "foo.d/ t.pdf".split()
diff --git a/test/t/test_adb.py b/test/t/test_adb.py
index 081a1047..74b0d372 100644
--- a/test/t/test_adb.py
+++ b/test/t/test_adb.py
@@ -5,3 +5,7 @@ class TestAdb:
@pytest.mark.complete("adb ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("adb -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_alpine.py b/test/t/test_alpine.py
index a8a83a0b..dcc05d30 100644
--- a/test/t/test_alpine.py
+++ b/test/t/test_alpine.py
@@ -2,6 +2,6 @@ import pytest
class TestAlpine:
- @pytest.mark.complete("alpine -")
+ @pytest.mark.complete("alpine -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ant.py b/test/t/test_ant.py
index e18b6eb4..b14beb94 100644
--- a/test/t/test_ant.py
+++ b/test/t/test_ant.py
@@ -3,7 +3,7 @@ import pytest
@pytest.mark.bashcomp(ignore_env=r"^\+ANT_ARGS=")
class TestAnt:
- @pytest.mark.complete("ant -")
+ @pytest.mark.complete("ant -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_appdata_validate.py b/test/t/test_appdata_validate.py
index d57aa992..8166cf8b 100644
--- a/test/t/test_appdata_validate.py
+++ b/test/t/test_appdata_validate.py
@@ -6,3 +6,7 @@ class TestAppdataValidate:
@pytest.mark.complete("appdata-validate ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("appdata-validate -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_apt_cache.py b/test/t/test_apt_cache.py
index 0cb50ef6..a1c29cda 100644
--- a/test/t/test_apt_cache.py
+++ b/test/t/test_apt_cache.py
@@ -7,7 +7,7 @@ class TestAptCache:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("apt-cache showsrc [")
+ @pytest.mark.complete("apt-cache showsrc [", require_cmd=True)
def test_2(self, completion):
# Doesn't actually fail on grep errors, but takes a long time.
assert not completion
diff --git a/test/t/test_arch.py b/test/t/test_arch.py
index 69e0b1ae..7a0f4478 100644
--- a/test/t/test_arch.py
+++ b/test/t/test_arch.py
@@ -3,6 +3,6 @@ import pytest
@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",))
class TestArch:
- @pytest.mark.complete("arch -")
+ @pytest.mark.complete("arch -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_arp.py b/test/t/test_arp.py
index 35963d75..cd038bdb 100644
--- a/test/t/test_arp.py
+++ b/test/t/test_arp.py
@@ -1,14 +1,13 @@
import pytest
-from conftest import in_docker
-
class TestArp:
- @pytest.mark.xfail(in_docker(), reason="Probably fails in docker")
- @pytest.mark.complete("arp ")
+ @pytest.mark.complete(
+ "arp ", require_cmd=True, skipif='test -z "$(arp 2>/dev/null)"'
+ )
def test_1(self, completion):
assert completion
- @pytest.mark.complete("arp -")
+ @pytest.mark.complete("arp -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_arping.py b/test/t/test_arping.py
index 850344be..0eef5c9e 100644
--- a/test/t/test_arping.py
+++ b/test/t/test_arping.py
@@ -6,6 +6,6 @@ class TestArping:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("arping -")
+ @pytest.mark.complete("arping -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_arpspoof.py b/test/t/test_arpspoof.py
index 9fcf20b7..c8955f8d 100644
--- a/test/t/test_arpspoof.py
+++ b/test/t/test_arpspoof.py
@@ -2,6 +2,6 @@ import pytest
class TestArpspoof:
- @pytest.mark.complete("arpspoof -")
+ @pytest.mark.complete("arpspoof -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_asciidoc.py b/test/t/test_asciidoc.py
index b295a27d..b748dcd1 100644
--- a/test/t/test_asciidoc.py
+++ b/test/t/test_asciidoc.py
@@ -5,3 +5,7 @@ class TestAsciidoc:
@pytest.mark.complete("asciidoc ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("asciidoc -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_automake.py b/test/t/test_automake.py
index 5d25c6a7..2174e024 100644
--- a/test/t/test_automake.py
+++ b/test/t/test_automake.py
@@ -5,3 +5,7 @@ class TestAutomake:
@pytest.mark.complete("automake ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("automake -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_autoscan.py b/test/t/test_autoscan.py
index b2667543..d3d45a15 100644
--- a/test/t/test_autoscan.py
+++ b/test/t/test_autoscan.py
@@ -5,3 +5,7 @@ class TestAutoscan:
@pytest.mark.complete("autoscan ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("autoscan -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_autossh.py b/test/t/test_autossh.py
new file mode 100644
index 00000000..86407128
--- /dev/null
+++ b/test/t/test_autossh.py
@@ -0,0 +1,7 @@
+import pytest
+
+
+class TestAutossh:
+ @pytest.mark.complete("autossh -", require_cmd=True)
+ def test_1(self, completion):
+ assert completion
diff --git a/test/t/test_awk.py b/test/t/test_awk.py
index ad2034d1..9fd73804 100644
--- a/test/t/test_awk.py
+++ b/test/t/test_awk.py
@@ -5,3 +5,7 @@ class TestAwk:
@pytest.mark.complete("awk ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("awk -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_badblocks.py b/test/t/test_badblocks.py
index 57a559de..58130b32 100644
--- a/test/t/test_badblocks.py
+++ b/test/t/test_badblocks.py
@@ -5,3 +5,8 @@ class TestBadblocks:
@pytest.mark.complete("badblocks ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("badblocks -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
+ assert all(x not in completion for x in "-w -X".split())
diff --git a/test/t/test_base64.py b/test/t/test_base64.py
index efc35ebb..957f5a37 100644
--- a/test/t/test_base64.py
+++ b/test/t/test_base64.py
@@ -5,3 +5,7 @@ class TestBase64:
@pytest.mark.complete("base64 ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("base64 -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_bash.py b/test/t/test_bash.py
index d6e6959a..97a3b8d6 100644
--- a/test/t/test_bash.py
+++ b/test/t/test_bash.py
@@ -2,6 +2,6 @@ import pytest
class TestBash:
- @pytest.mark.complete("bash --")
+ @pytest.mark.complete("bash --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_bc.py b/test/t/test_bc.py
index effcbaea..7f8056e5 100644
--- a/test/t/test_bc.py
+++ b/test/t/test_bc.py
@@ -2,6 +2,6 @@ import pytest
class TestBc:
- @pytest.mark.complete("bc --")
+ @pytest.mark.complete("bc --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_bind.py b/test/t/test_bind.py
index f97a246e..97a50444 100644
--- a/test/t/test_bind.py
+++ b/test/t/test_bind.py
@@ -2,7 +2,7 @@ import pytest
class TestBind:
- @pytest.mark.complete("bind -")
+ @pytest.mark.complete("bind -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_bison.py b/test/t/test_bison.py
index 47c4908c..a4a481a7 100644
--- a/test/t/test_bison.py
+++ b/test/t/test_bison.py
@@ -2,6 +2,6 @@ import pytest
class TestBison:
- @pytest.mark.complete("bison --")
+ @pytest.mark.complete("bison --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_bzip2.py b/test/t/test_bzip2.py
index d1cad249..3b501ea4 100644
--- a/test/t/test_bzip2.py
+++ b/test/t/test_bzip2.py
@@ -9,3 +9,7 @@ class TestBzip2:
@pytest.mark.complete("bzip2 ~")
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("bzip2 -")
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_cal.py b/test/t/test_cal.py
index 27102c7a..83d17fff 100644
--- a/test/t/test_cal.py
+++ b/test/t/test_cal.py
@@ -5,3 +5,7 @@ class TestCal:
@pytest.mark.complete("cal ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("cal -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_carton.py b/test/t/test_carton.py
new file mode 100644
index 00000000..1c2e4531
--- /dev/null
+++ b/test/t/test_carton.py
@@ -0,0 +1,11 @@
+import pytest
+
+
+class TestCarton:
+ @pytest.mark.complete("carton ", require_cmd=True)
+ def test_commands(self, completion):
+ assert all(x in completion for x in "help install".split())
+
+ @pytest.mark.complete("carton install -", require_cmd=True)
+ def test_install_options(self, completion):
+ assert all(x in completion for x in "--cached --help".split())
diff --git a/test/t/test_cat.py b/test/t/test_cat.py
index 94245e8f..5fa4c8ff 100644
--- a/test/t/test_cat.py
+++ b/test/t/test_cat.py
@@ -5,3 +5,7 @@ class TestCat:
@pytest.mark.complete("cat ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("cat -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_ccache.py b/test/t/test_ccache.py
index 573e3e44..64620ef4 100644
--- a/test/t/test_ccache.py
+++ b/test/t/test_ccache.py
@@ -2,11 +2,11 @@ import pytest
class TestCcache:
- @pytest.mark.complete("ccache -")
+ @pytest.mark.complete("ccache -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("ccache --clea")
+ @pytest.mark.complete("ccache --clea", require_cmd=True)
def test_2(self, completion):
assert all(x in completion for x in "--cleanup --clear".split())
@@ -18,10 +18,10 @@ class TestCcache:
def test_4(self, completion):
assert "stty" in completion
- @pytest.mark.complete("ccache --hel")
+ @pytest.mark.complete("ccache --hel", require_cmd=True)
def test_5(self, completion):
assert "--help" in completion
- @pytest.mark.complete("ccache --zero-stats ls --hel")
+ @pytest.mark.complete("ccache --zero-stats sh +")
def test_6(self, completion):
- assert "--help" in completion
+ assert "+x" in completion
diff --git a/test/t/test_ccze.py b/test/t/test_ccze.py
index c54a1fa1..abf1234f 100644
--- a/test/t/test_ccze.py
+++ b/test/t/test_ccze.py
@@ -2,7 +2,7 @@ import pytest
class TestCcze:
- @pytest.mark.complete("ccze ")
+ @pytest.mark.complete("ccze ", require_cmd=True)
def test_1(self, completion):
assert completion
@@ -14,6 +14,6 @@ class TestCcze:
def test_3(self, completion):
assert completion
- @pytest.mark.complete("ccze --plugin=")
+ @pytest.mark.complete("ccze --plugin=", require_cmd=True)
def test_4(self, completion):
assert completion
diff --git a/test/t/test_cfagent.py b/test/t/test_cfagent.py
index f4b477bc..990fc62e 100644
--- a/test/t/test_cfagent.py
+++ b/test/t/test_cfagent.py
@@ -2,6 +2,6 @@ import pytest
class TestCfagent:
- @pytest.mark.complete("cfagent -")
+ @pytest.mark.complete("cfagent -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_chage.py b/test/t/test_chage.py
index 6ef34435..3957ae39 100644
--- a/test/t/test_chage.py
+++ b/test/t/test_chage.py
@@ -5,3 +5,7 @@ class TestChage:
@pytest.mark.complete("chage ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("chage -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_checksec.py b/test/t/test_checksec.py
index 4fce13ff..5a11037d 100644
--- a/test/t/test_checksec.py
+++ b/test/t/test_checksec.py
@@ -2,6 +2,6 @@ import pytest
class TestChecksec:
- @pytest.mark.complete("checksec -")
+ @pytest.mark.complete("checksec -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_chkconfig.py b/test/t/test_chkconfig.py
index c610a5d5..08e9827f 100644
--- a/test/t/test_chkconfig.py
+++ b/test/t/test_chkconfig.py
@@ -9,7 +9,7 @@ class TestChkconfig:
# systemd may not be running e.g. in a docker container, and listing
# services will then fail.
@pytest.mark.complete(
- "chkconfig ", skipif="! systemctl list-units &>/dev/null"
+ "chkconfig ", xfail="! systemctl list-units &>/dev/null"
)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_chmod.py b/test/t/test_chmod.py
index ed59cf13..3838b557 100644
--- a/test/t/test_chmod.py
+++ b/test/t/test_chmod.py
@@ -12,7 +12,7 @@ class TestChmod:
def test_2(self, completion):
assert completion
- @pytest.mark.complete("chmod -")
+ @pytest.mark.complete("chmod -", require_cmd=True)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_chpasswd.py b/test/t/test_chpasswd.py
index ce16a75d..ebb292f3 100644
--- a/test/t/test_chpasswd.py
+++ b/test/t/test_chpasswd.py
@@ -2,6 +2,6 @@ import pytest
class TestChpasswd:
- @pytest.mark.complete("chpasswd -")
+ @pytest.mark.complete("chpasswd -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_chromium_browser.py b/test/t/test_chromium_browser.py
index 75cabdaf..b0b19b29 100644
--- a/test/t/test_chromium_browser.py
+++ b/test/t/test_chromium_browser.py
@@ -7,7 +7,19 @@ class TestChromiumBrowser:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("chromium-browser -")
+ @pytest.mark.complete(
+ "chromium-browser -", xfail="! chromium-browser --help &>/dev/null"
+ )
def test_2(self, completion):
assert completion
assert not completion.endswith(" ")
+
+ @pytest.mark.complete("chromium-browser --proxy-server=")
+ def test_proxy_server_scheme(self, completion):
+ assert completion
+ assert not completion.endswith(" ")
+ assert all(x.endswith("://") for x in completion)
+
+ @pytest.mark.complete("chromium-browser --proxy-server=http://")
+ def test_proxy_server_host(self, completion):
+ assert completion
diff --git a/test/t/test_chronyc.py b/test/t/test_chronyc.py
index fdc91ac5..1fee246b 100644
--- a/test/t/test_chronyc.py
+++ b/test/t/test_chronyc.py
@@ -2,10 +2,10 @@ import pytest
class TestChronyc:
- @pytest.mark.complete("chronyc ")
+ @pytest.mark.complete("chronyc ", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("chronyc -")
+ @pytest.mark.complete("chronyc -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_chroot.py b/test/t/test_chroot.py
index 99ca56b0..08ace867 100644
--- a/test/t/test_chroot.py
+++ b/test/t/test_chroot.py
@@ -10,3 +10,7 @@ class TestChroot:
def test_2(self, completion):
"""Should complete dirs only, also when invoked using full path."""
assert completion == ["bar bar.d/", "foo.d/"]
+
+ @pytest.mark.complete("chroot -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_chrpath.py b/test/t/test_chrpath.py
index 036a1a41..8e94dcb6 100644
--- a/test/t/test_chrpath.py
+++ b/test/t/test_chrpath.py
@@ -6,6 +6,6 @@ class TestChrpath:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("chrpath -")
+ @pytest.mark.complete("chrpath -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_chsh.py b/test/t/test_chsh.py
index 26e3a0a3..fe1c7f69 100644
--- a/test/t/test_chsh.py
+++ b/test/t/test_chsh.py
@@ -9,3 +9,7 @@ class TestChsh:
@pytest.mark.complete("chsh -s ")
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("chsh -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_civclient.py b/test/t/test_civclient.py
index cff70f47..bf0c8d89 100644
--- a/test/t/test_civclient.py
+++ b/test/t/test_civclient.py
@@ -2,6 +2,6 @@ import pytest
class TestCivclient:
- @pytest.mark.complete("civclient -")
+ @pytest.mark.complete("civclient -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_civserver.py b/test/t/test_civserver.py
index b822ddef..0b8e5d51 100644
--- a/test/t/test_civserver.py
+++ b/test/t/test_civserver.py
@@ -2,6 +2,6 @@ import pytest
class TestCivserver:
- @pytest.mark.complete("civserver -")
+ @pytest.mark.complete("civserver -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_cksfv.py b/test/t/test_cksfv.py
index b4df8767..b3656597 100644
--- a/test/t/test_cksfv.py
+++ b/test/t/test_cksfv.py
@@ -2,6 +2,6 @@ import pytest
class TestCksfv:
- @pytest.mark.complete("cksfv -")
+ @pytest.mark.complete("cksfv -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_colordiff.py b/test/t/test_colordiff.py
new file mode 100644
index 00000000..f0e0a291
--- /dev/null
+++ b/test/t/test_colordiff.py
@@ -0,0 +1,11 @@
+import pytest
+
+
+class TestColordiff:
+ @pytest.mark.complete("colordiff ")
+ def test_basic(self, completion):
+ assert completion
+
+ @pytest.mark.complete("colordiff -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_compgen.py b/test/t/test_compgen.py
new file mode 100644
index 00000000..893abdf8
--- /dev/null
+++ b/test/t/test_compgen.py
@@ -0,0 +1,7 @@
+import pytest
+
+
+class TestCompgen:
+ @pytest.mark.complete(r"compgen -f a\'b/", cwd="compgen")
+ def test_1(self, completion):
+ assert not completion
diff --git a/test/t/test_configure.py b/test/t/test_configure.py
index 17bc9d48..0fc61171 100644
--- a/test/t/test_configure.py
+++ b/test/t/test_configure.py
@@ -8,7 +8,7 @@ import pytest
)
)
class TestConfigure:
- @pytest.mark.complete("configure --")
+ @pytest.mark.complete("configure --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_convert.py b/test/t/test_convert.py
index 90dfb477..c903ea0d 100644
--- a/test/t/test_convert.py
+++ b/test/t/test_convert.py
@@ -9,3 +9,7 @@ class TestConvert:
@pytest.mark.complete("convert -format ")
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("convert -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_cp.py b/test/t/test_cp.py
index a25998fc..7634df75 100644
--- a/test/t/test_cp.py
+++ b/test/t/test_cp.py
@@ -5,3 +5,7 @@ class TestCp:
@pytest.mark.complete("cp ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("cp -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_cpan2dist.py b/test/t/test_cpan2dist.py
index 13feae9e..f456c0ce 100644
--- a/test/t/test_cpan2dist.py
+++ b/test/t/test_cpan2dist.py
@@ -2,6 +2,6 @@ import pytest
class TestCpan2dist:
- @pytest.mark.complete("cpan2dist -")
+ @pytest.mark.complete("cpan2dist -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_cpio.py b/test/t/test_cpio.py
index 69bb5702..1b9e37df 100644
--- a/test/t/test_cpio.py
+++ b/test/t/test_cpio.py
@@ -11,6 +11,8 @@ class TestCpio:
@pytest.mark.complete("cpio -R ")
def test_2(self, bash, completion):
users = sorted(
- assert_bash_exec(bash, "compgen -A user", want_output=True).split()
+ assert_bash_exec(bash, "compgen -A user", want_output=True)
+ .strip()
+ .splitlines()
)
- assert completion == users
+ assert list(completion) == users
diff --git a/test/t/test_cppcheck.py b/test/t/test_cppcheck.py
index d5e3af9b..da770786 100644
--- a/test/t/test_cppcheck.py
+++ b/test/t/test_cppcheck.py
@@ -6,7 +6,7 @@ class TestCppcheck:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("cppcheck -")
+ @pytest.mark.complete("cppcheck -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_createdb.py b/test/t/test_createdb.py
index 7e226438..030338a0 100644
--- a/test/t/test_createdb.py
+++ b/test/t/test_createdb.py
@@ -4,6 +4,8 @@ import pytest
class TestCreatedb:
# --help can fail due to missing package dependencies, e.g. on Ubuntu 14
- @pytest.mark.complete("createdb -", skipif="! createdb --help &>/dev/null")
+ @pytest.mark.complete(
+ "createdb -", require_cmd=True, xfail="! createdb --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_createuser.py b/test/t/test_createuser.py
index f25f10f7..ea8d0e38 100644
--- a/test/t/test_createuser.py
+++ b/test/t/test_createuser.py
@@ -5,7 +5,7 @@ class TestCreateuser:
# --help can fail due to missing package dependencies, e.g. on Ubuntu 14
@pytest.mark.complete(
- "createuser -", skipif="! createuser --help &>/dev/null"
+ "createuser -", xfail="! createuser --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_cryptsetup.py b/test/t/test_cryptsetup.py
index 235ac4fc..fdc981b8 100644
--- a/test/t/test_cryptsetup.py
+++ b/test/t/test_cryptsetup.py
@@ -5,3 +5,7 @@ class TestCryptsetup:
@pytest.mark.complete("cryptsetup ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("cryptsetup -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_csplit.py b/test/t/test_csplit.py
index 54eab34c..609c7e55 100644
--- a/test/t/test_csplit.py
+++ b/test/t/test_csplit.py
@@ -5,3 +5,7 @@ class TestCsplit:
@pytest.mark.complete("csplit ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("csplit -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_curl.py b/test/t/test_curl.py
index 324fba2a..ebccca95 100644
--- a/test/t/test_curl.py
+++ b/test/t/test_curl.py
@@ -2,7 +2,7 @@ import pytest
class TestCurl:
- @pytest.mark.complete("curl --h")
+ @pytest.mark.complete("curl --h", require_cmd=True)
def test_1(self, completion):
assert completion
@@ -17,3 +17,12 @@ class TestCurl:
@pytest.mark.complete("curl --o f")
def test_4(self, completion):
assert not completion
+
+ @pytest.mark.complete("curl --data @", cwd="shared/default/foo.d")
+ def test_data_atfile(self, completion):
+ assert completion == "@foo"
+
+ @pytest.mark.complete("curl --data @foo.", cwd="shared/default")
+ def test_data_atfile_dir(self, completion):
+ assert completion == "@foo.d/"
+ assert not completion.endswith(" ")
diff --git a/test/t/test_cut.py b/test/t/test_cut.py
index 31fa636a..b0faca6a 100644
--- a/test/t/test_cut.py
+++ b/test/t/test_cut.py
@@ -5,3 +5,7 @@ class TestCut:
@pytest.mark.complete("cut ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("cut -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_cvs.py b/test/t/test_cvs.py
index 825acbf5..ab7fead8 100644
--- a/test/t/test_cvs.py
+++ b/test/t/test_cvs.py
@@ -14,3 +14,7 @@ class TestCvs:
@pytest.mark.complete("cvs diff foo/", cwd="cvs")
def test_3(self, completion):
assert completion == "foo/bar"
+
+ @pytest.mark.complete("cvs -", require_cmd=True)
+ def test_4(self, completion):
+ assert completion
diff --git a/test/t/test_cvsps.py b/test/t/test_cvsps.py
index 0a4da9ba..4039893c 100644
--- a/test/t/test_cvsps.py
+++ b/test/t/test_cvsps.py
@@ -3,7 +3,7 @@ import pytest
@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/cvs",))
class TestCvsps:
- @pytest.mark.complete("cvsps -")
+ @pytest.mark.complete("cvsps -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_date.py b/test/t/test_date.py
index 8df574e9..57d61b81 100644
--- a/test/t/test_date.py
+++ b/test/t/test_date.py
@@ -5,3 +5,7 @@ class TestDate:
@pytest.mark.complete("date ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("date -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_dcop.py b/test/t/test_dcop.py
index 669725e2..5c3c04d0 100644
--- a/test/t/test_dcop.py
+++ b/test/t/test_dcop.py
@@ -1,14 +1,7 @@
-import subprocess
-
import pytest
class TestDcop:
- @pytest.mark.complete("dcop ")
+ @pytest.mark.complete("dcop ", require_cmd=True)
def test_1(self, completion):
- try:
- subprocess.check_call("dcop &>/dev/null", shell=True)
- except BaseException:
- assert not completion
- else:
- assert completion
+ assert completion
diff --git a/test/t/test_dd.py b/test/t/test_dd.py
index 616f4d4a..be1829d3 100644
--- a/test/t/test_dd.py
+++ b/test/t/test_dd.py
@@ -2,7 +2,13 @@ import pytest
class TestDd:
- @pytest.mark.complete("dd --")
+ @pytest.mark.complete(
+ "dd --",
+ xfail=(
+ "! dd --help &>/dev/null || "
+ "! dd --help 2>&1 | command grep -qF -- --help"
+ ),
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_declare.py b/test/t/test_declare.py
index b17affc2..a61d9260 100644
--- a/test/t/test_declare.py
+++ b/test/t/test_declare.py
@@ -2,11 +2,11 @@ import pytest
class TestDeclare:
- @pytest.mark.complete("declare -")
+ @pytest.mark.complete("declare -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("declare +")
+ @pytest.mark.complete("declare +", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_deja_dup.py b/test/t/test_deja_dup.py
index 1da29e99..56e59f9c 100644
--- a/test/t/test_deja_dup.py
+++ b/test/t/test_deja_dup.py
@@ -3,7 +3,7 @@ import pytest
@pytest.mark.bashcomp(cmd="deja-dup")
class TestDejaDup:
- @pytest.mark.complete("deja-dup -")
+ @pytest.mark.complete("deja-dup -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_desktop_file_validate.py b/test/t/test_desktop_file_validate.py
index e007a956..ed4b55b8 100644
--- a/test/t/test_desktop_file_validate.py
+++ b/test/t/test_desktop_file_validate.py
@@ -6,3 +6,7 @@ class TestDesktopFileValidate:
@pytest.mark.complete("desktop-file-validate ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("desktop-file-validate -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_df.py b/test/t/test_df.py
index 247311cc..be28e6cb 100644
--- a/test/t/test_df.py
+++ b/test/t/test_df.py
@@ -5,3 +5,7 @@ class TestDf:
@pytest.mark.complete("df ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("df -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_dhclient.py b/test/t/test_dhclient.py
index fdfbd473..c6a1af41 100644
--- a/test/t/test_dhclient.py
+++ b/test/t/test_dhclient.py
@@ -2,6 +2,6 @@ import pytest
class TestDhclient:
- @pytest.mark.complete("dhclient -")
+ @pytest.mark.complete("dhclient -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_dict.py b/test/t/test_dict.py
index 65f6b129..99c4a210 100644
--- a/test/t/test_dict.py
+++ b/test/t/test_dict.py
@@ -2,6 +2,6 @@ import pytest
class TestDict:
- @pytest.mark.complete("dict -")
+ @pytest.mark.complete("dict -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_diff.py b/test/t/test_diff.py
index 25157bd9..eb81506b 100644
--- a/test/t/test_diff.py
+++ b/test/t/test_diff.py
@@ -2,6 +2,6 @@ import pytest
class TestDiff:
- @pytest.mark.complete("diff --")
+ @pytest.mark.complete("diff --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_dir.py b/test/t/test_dir.py
index 3026d502..f8568fb5 100644
--- a/test/t/test_dir.py
+++ b/test/t/test_dir.py
@@ -5,3 +5,7 @@ class TestDir:
@pytest.mark.complete("dir ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("dir -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_display.py b/test/t/test_display.py
index 9f5c1004..4f076b81 100644
--- a/test/t/test_display.py
+++ b/test/t/test_display.py
@@ -6,6 +6,6 @@ class TestDisplay:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("display -")
+ @pytest.mark.complete("display -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_dmesg.py b/test/t/test_dmesg.py
index 4416fe1c..a081fb67 100644
--- a/test/t/test_dmesg.py
+++ b/test/t/test_dmesg.py
@@ -2,6 +2,6 @@ import pytest
class TestDmesg:
- @pytest.mark.complete("dmesg -")
+ @pytest.mark.complete("dmesg -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_dmypy.py b/test/t/test_dmypy.py
new file mode 100644
index 00000000..efaef7ca
--- /dev/null
+++ b/test/t/test_dmypy.py
@@ -0,0 +1,12 @@
+import pytest
+
+
+class TestDmypy:
+ @pytest.mark.complete("dmypy ", require_cmd=True)
+ def test_commands(self, completion):
+ assert "help" in completion
+ assert not any("," in x for x in completion)
+
+ @pytest.mark.complete("dmypy -", require_cmd=True)
+ def test_options(self, completion):
+ assert "--help" in completion
diff --git a/test/t/test_dnsspoof.py b/test/t/test_dnsspoof.py
index fae6c430..b3380d14 100644
--- a/test/t/test_dnsspoof.py
+++ b/test/t/test_dnsspoof.py
@@ -2,6 +2,6 @@ import pytest
class TestDnsspoof:
- @pytest.mark.complete("dnsspoof -")
+ @pytest.mark.complete("dnsspoof -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_dpkg.py b/test/t/test_dpkg.py
index e609ee86..eb1228b7 100644
--- a/test/t/test_dpkg.py
+++ b/test/t/test_dpkg.py
@@ -2,13 +2,11 @@ import pytest
class TestDpkg:
- @pytest.mark.complete("dpkg --c")
+ @pytest.mark.complete("dpkg --c", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete(
- "dpkg -L ", skipif='test -z "$(dpkg -l 2>/dev/null)"'
- )
+ @pytest.mark.complete("dpkg -L ", xfail='test -z "$(dpkg -l 2>/dev/null)"')
def test_2(self, completion):
assert completion
diff --git a/test/t/test_dpkg_deb.py b/test/t/test_dpkg_deb.py
index 4bd7368b..c1ad8191 100644
--- a/test/t/test_dpkg_deb.py
+++ b/test/t/test_dpkg_deb.py
@@ -3,6 +3,6 @@ import pytest
@pytest.mark.bashcomp(cmd="dpkg-deb")
class TestDpkgDeb:
- @pytest.mark.complete("dpkg-deb --c")
+ @pytest.mark.complete("dpkg-deb --c", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_dropdb.py b/test/t/test_dropdb.py
index 7e0b7929..2f658576 100644
--- a/test/t/test_dropdb.py
+++ b/test/t/test_dropdb.py
@@ -4,6 +4,8 @@ import pytest
class TestDropdb:
# --help can fail due to missing package dependencies, e.g. on Ubuntu 14
- @pytest.mark.complete("dropdb -", skipif="! dropdb --help &>/dev/null")
+ @pytest.mark.complete(
+ "dropdb -", require_cmd=True, xfail="! dropdb --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_dselect.py b/test/t/test_dselect.py
index 3145cc40..8e9d24ef 100644
--- a/test/t/test_dselect.py
+++ b/test/t/test_dselect.py
@@ -6,6 +6,6 @@ class TestDselect:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("dselect -")
+ @pytest.mark.complete("dselect -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_du.py b/test/t/test_du.py
index c014b069..3d73e99a 100644
--- a/test/t/test_du.py
+++ b/test/t/test_du.py
@@ -5,3 +5,7 @@ class TestDu:
@pytest.mark.complete("du ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("du -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_dumpe2fs.py b/test/t/test_dumpe2fs.py
index fa7590e6..eacb1fe1 100644
--- a/test/t/test_dumpe2fs.py
+++ b/test/t/test_dumpe2fs.py
@@ -5,3 +5,7 @@ class TestDumpe2fs:
@pytest.mark.complete("dumpe2fs ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("dumpe2fs -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_e2freefrag.py b/test/t/test_e2freefrag.py
index 6685382d..10eb41de 100644
--- a/test/t/test_e2freefrag.py
+++ b/test/t/test_e2freefrag.py
@@ -5,3 +5,7 @@ class TestE2freefrag:
@pytest.mark.complete("e2freefrag ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("e2freefrag -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_ecryptfs_migrate_home.py b/test/t/test_ecryptfs_migrate_home.py
index fd49ca8b..f2115d27 100644
--- a/test/t/test_ecryptfs_migrate_home.py
+++ b/test/t/test_ecryptfs_migrate_home.py
@@ -3,6 +3,10 @@ import pytest
@pytest.mark.bashcomp(cmd="ecryptfs-migrate-home")
class TestEcryptfsMigrateHome:
- @pytest.mark.complete("ecryptfs-migrate-home ")
+ @pytest.mark.complete("ecryptfs-migrate-home ", require_cmd=True)
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("ecryptfs-migrate-home -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_eject.py b/test/t/test_eject.py
index 037ea98e..d4ec1bd1 100644
--- a/test/t/test_eject.py
+++ b/test/t/test_eject.py
@@ -2,6 +2,6 @@ import pytest
class TestEject:
- @pytest.mark.complete("eject -")
+ @pytest.mark.complete("eject -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_enscript.py b/test/t/test_enscript.py
index 2e4ff51a..97120e3e 100644
--- a/test/t/test_enscript.py
+++ b/test/t/test_enscript.py
@@ -2,6 +2,6 @@ import pytest
class TestEnscript:
- @pytest.mark.complete("enscript --")
+ @pytest.mark.complete("enscript --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_env.py b/test/t/test_env.py
index 57ed9769..3d1a684e 100644
--- a/test/t/test_env.py
+++ b/test/t/test_env.py
@@ -2,6 +2,6 @@ import pytest
class TestEnv:
- @pytest.mark.complete("env --", skipif="! env --help &>/dev/null")
+ @pytest.mark.complete("env --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_eog.py b/test/t/test_eog.py
index c095934f..5ae21d91 100644
--- a/test/t/test_eog.py
+++ b/test/t/test_eog.py
@@ -5,3 +5,7 @@ class TestEog:
@pytest.mark.complete("eog ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("eog -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_ether_wake.py b/test/t/test_ether_wake.py
index b9dac0b4..7afe2862 100644
--- a/test/t/test_ether_wake.py
+++ b/test/t/test_ether_wake.py
@@ -1,8 +1,18 @@
+import os
+
import pytest
@pytest.mark.bashcomp(cmd="ether-wake")
class TestEtherWake:
+ @pytest.mark.xfail(
+ os.environ.get("NETWORK") == "none",
+ reason="MAC addresses may be N/A with no networking configured",
+ )
@pytest.mark.complete("ether-wake ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("ether-wake -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_evince.py b/test/t/test_evince.py
index 0dc44f38..9e9245de 100644
--- a/test/t/test_evince.py
+++ b/test/t/test_evince.py
@@ -16,3 +16,7 @@ class TestEvince:
".ps.bz2 .ps.BZ2 .PS.bz2 .PS.BZ2 .ps.gz .ps.GZ .PS.gz .PS.GZ "
".tga .TGA .tif .TIF .tiff .TIFF .xpm .XPM .xwd .XWD".split()
)
+
+ @pytest.mark.complete("evince -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_expand.py b/test/t/test_expand.py
index 004c018b..11f4bdb8 100644
--- a/test/t/test_expand.py
+++ b/test/t/test_expand.py
@@ -2,6 +2,6 @@ import pytest
class TestExpand:
- @pytest.mark.complete("expand --", skipif="! expand --help &>/dev/null")
+ @pytest.mark.complete("expand --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_explodepkg.py b/test/t/test_explodepkg.py
index 29463dfd..940fec80 100644
--- a/test/t/test_explodepkg.py
+++ b/test/t/test_explodepkg.py
@@ -8,11 +8,16 @@ class TestExplodepkg:
@pytest.mark.complete("explodepkg ", cwd="slackware/home")
def test_1(self, completion):
expected = sorted(
- x
- for x in os.listdir("slackware/home")
- if os.path.isdir("./%s" % x)
- or (
- os.path.isfile("./%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z")
- )
+ [
+ "%s/" % x
+ for x in os.listdir("slackware/home")
+ if os.path.isdir("./slackware/home/%s" % x)
+ ]
+ + [
+ x
+ for x in os.listdir("slackware/home")
+ if os.path.isfile("./slackware/home/%s" % x)
+ and fnmatch.fnmatch(x, "*.t[bglx]z")
+ ]
)
assert completion == expected
diff --git a/test/t/test_export.py b/test/t/test_export.py
index 59dfdb2e..8738913a 100644
--- a/test/t/test_export.py
+++ b/test/t/test_export.py
@@ -31,6 +31,6 @@ class TestExport:
def test_7(self, completion):
assert completion
- @pytest.mark.complete("export -")
+ @pytest.mark.complete("export -", require_cmd=True)
def test_8(self, completion):
assert completion
diff --git a/test/t/test_faillog.py b/test/t/test_faillog.py
index d9799d57..edf490b5 100644
--- a/test/t/test_faillog.py
+++ b/test/t/test_faillog.py
@@ -2,6 +2,6 @@ import pytest
class TestFaillog:
- @pytest.mark.complete("faillog -")
+ @pytest.mark.complete("faillog -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_feh.py b/test/t/test_feh.py
index 1802e25f..51bd77b6 100644
--- a/test/t/test_feh.py
+++ b/test/t/test_feh.py
@@ -7,7 +7,9 @@ class TestFeh:
assert completion
@pytest.mark.complete(
- "feh --lis", skipif="feh --help 2>&1 | grep -qF 'man feh'"
+ "feh --lis",
+ xfail="feh --help 2>&1 | command grep -qF 'man feh'",
+ require_cmd=True,
)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_file.py b/test/t/test_file.py
index cfd2c100..0c19eb4d 100644
--- a/test/t/test_file.py
+++ b/test/t/test_file.py
@@ -6,6 +6,6 @@ class TestFile:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("file -")
+ @pytest.mark.complete("file -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_filefrag.py b/test/t/test_filefrag.py
index 860b2512..342e89ce 100644
--- a/test/t/test_filefrag.py
+++ b/test/t/test_filefrag.py
@@ -5,3 +5,7 @@ class TestFilefrag:
@pytest.mark.complete("filefrag ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("filefrag -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_filesnarf.py b/test/t/test_filesnarf.py
index cd399d4a..cee621ec 100644
--- a/test/t/test_filesnarf.py
+++ b/test/t/test_filesnarf.py
@@ -2,6 +2,6 @@ import pytest
class TestFilesnarf:
- @pytest.mark.complete("filesnarf -")
+ @pytest.mark.complete("filesnarf -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_finger.py b/test/t/test_finger.py
index e3cdfacd..92c983fa 100644
--- a/test/t/test_finger.py
+++ b/test/t/test_finger.py
@@ -4,11 +4,22 @@ from conftest import assert_bash_exec
class TestFinger:
- @pytest.mark.complete("finger ")
- def test_1(self, bash, completion):
- users_at = sorted(
+ @pytest.fixture(scope="class")
+ def users_at(self, bash):
+ return sorted(
assert_bash_exec(
bash, "compgen -A user -S @", want_output=True
).split()
)
+
+ @pytest.mark.complete("finger ")
+ def test_1(self, bash, completion, users_at):
assert completion == users_at
+
+ @pytest.mark.complete("finger r")
+ def test_2(self, bash, completion, users_at):
+ if not any(x.startswith("r") for x in users_at):
+ pytest.skip("No users starting with r")
+ assert completion
+ assert all(x.startswith("r") for x in completion)
+ assert not completion.endswith(" ")
diff --git a/test/t/test_fio.py b/test/t/test_fio.py
index 8dd6f789..0f6eba74 100644
--- a/test/t/test_fio.py
+++ b/test/t/test_fio.py
@@ -6,7 +6,7 @@ class TestFio:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("fio --")
+ @pytest.mark.complete("fio --", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_firefox.py b/test/t/test_firefox.py
index cbba2c6c..2e052553 100644
--- a/test/t/test_firefox.py
+++ b/test/t/test_firefox.py
@@ -6,7 +6,7 @@ class TestFirefox:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("firefox -")
+ @pytest.mark.complete("firefox -", require_cmd=True)
def test_2(self, completion):
assert completion
assert not completion.endswith(" ")
diff --git a/test/t/test_flake8.py b/test/t/test_flake8.py
index 9922fb85..67649fa7 100644
--- a/test/t/test_flake8.py
+++ b/test/t/test_flake8.py
@@ -1,13 +1,14 @@
import pytest
-@pytest.mark.bashcomp(skipif="! flake8 --help &>/dev/null")
class TestFlake8:
@pytest.mark.complete("flake8 ")
def test_1(self, completion):
assert completion
- @pytest.mark.complete("flake8 -")
+ @pytest.mark.complete(
+ "flake8 -", require_cmd=True, xfail="! flake8 --help &>/dev/null"
+ )
def test_2(self, completion):
assert completion
diff --git a/test/t/test_fmt.py b/test/t/test_fmt.py
index dc3473ba..12706da2 100644
--- a/test/t/test_fmt.py
+++ b/test/t/test_fmt.py
@@ -2,6 +2,8 @@ import pytest
class TestFmt:
- @pytest.mark.complete("fmt -", skipif="! fmt --help &>/dev/null")
+ @pytest.mark.complete(
+ "fmt -", require_cmd=True, xfail="! fmt --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_fold.py b/test/t/test_fold.py
index 9a8fd2aa..1cbaef92 100644
--- a/test/t/test_fold.py
+++ b/test/t/test_fold.py
@@ -2,6 +2,6 @@ import pytest
class TestFold:
- @pytest.mark.complete("fold --", skipif="! fold --help &>/dev/null")
+ @pytest.mark.complete("fold --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_freeciv.py b/test/t/test_freeciv.py
index 1027e43c..a195eb86 100644
--- a/test/t/test_freeciv.py
+++ b/test/t/test_freeciv.py
@@ -2,6 +2,6 @@ import pytest
class TestFreeciv:
- @pytest.mark.complete("freeciv -")
+ @pytest.mark.complete("freeciv -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_freeciv_server.py b/test/t/test_freeciv_server.py
index 5546a5e9..8543a212 100644
--- a/test/t/test_freeciv_server.py
+++ b/test/t/test_freeciv_server.py
@@ -3,6 +3,6 @@ import pytest
@pytest.mark.bashcomp(cmd="freeciv-server")
class TestFreecivServer:
- @pytest.mark.complete("freeciv-server -")
+ @pytest.mark.complete("freeciv-server -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_fusermount.py b/test/t/test_fusermount.py
index 3781586d..dbb2bd99 100644
--- a/test/t/test_fusermount.py
+++ b/test/t/test_fusermount.py
@@ -5,3 +5,7 @@ class TestFusermount:
@pytest.mark.complete("fusermount ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("fusermount -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_gcc.py b/test/t/test_gcc.py
index 67f4ee57..87f25797 100644
--- a/test/t/test_gcc.py
+++ b/test/t/test_gcc.py
@@ -1,7 +1,67 @@
import pytest
+from conftest import assert_bash_exec
+
class TestGcc:
+ @pytest.fixture(scope="class")
+ def gcc_with_completion(self, bash):
+ got = assert_bash_exec(
+ bash, "gcc --help=common || :", want_output=True
+ )
+ if "--completion" not in got:
+ pytest.skip("GCC does not support --completion")
+
+ @pytest.fixture(scope="class")
+ def gcc_x86(self, bash):
+ got = assert_bash_exec(bash, "gcc -v || :", want_output=True)
+ if "Target: x86" not in got:
+ pytest.skip("Not a x86 GCC")
+
@pytest.mark.complete("gcc ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("gcc -fsanitize=add")
+ def test_enum_value(self, completion, gcc_with_completion):
+ assert completion == "-fsanitize=address"
+
+ @pytest.mark.complete("gcc -fsanitize=")
+ def test_enum_value_with_eq(self, completion, gcc_with_completion):
+ assert "address" in completion
+
+ @pytest.mark.complete("gcc -fno-ipa-ic")
+ def test_negative_option(self, completion, gcc_with_completion):
+ assert "-fno-ipa-icf" in completion
+
+ @pytest.mark.complete("gcc -fxyz-abc")
+ def test_no_completion(self, completion):
+ assert not completion
+
+ @pytest.mark.complete("gcc --param ")
+ def test_param_with_space(self, completion, gcc_with_completion):
+ assert len(completion) > 50
+ # starting with GCC 10.1 param end with =
+ assert (
+ "lto-partitions" in completion or "lto-partitions=" in completion
+ )
+
+ @pytest.mark.complete("gcc --param=lto-max-p")
+ def test_param_with_eq(self, completion, gcc_with_completion):
+ # starting with GCC 10.1 param end with =
+ assert (
+ completion == "--param=lto-max-partition"
+ or completion == "--param=lto-max-partition="
+ )
+
+ @pytest.mark.complete("gcc -march=amd")
+ def test_march(self, completion, gcc_with_completion, gcc_x86):
+ assert completion == "-march=amdfam10"
+
+ @pytest.mark.complete("gcc -march=")
+ def test_march_native(self, completion, gcc_with_completion):
+ assert "native" in completion
+
+ @pytest.mark.complete("gcc -mtune=")
+ def test_mtune_generic(self, completion, gcc_with_completion):
+ assert "generic" in completion
diff --git a/test/t/test_genisoimage.py b/test/t/test_genisoimage.py
index ba16cea2..bfcef3bc 100644
--- a/test/t/test_genisoimage.py
+++ b/test/t/test_genisoimage.py
@@ -5,3 +5,7 @@ class TestGenisoimage:
@pytest.mark.complete("genisoimage ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("genisoimage -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_geoiplookup.py b/test/t/test_geoiplookup.py
index d114d55f..9a1422bc 100644
--- a/test/t/test_geoiplookup.py
+++ b/test/t/test_geoiplookup.py
@@ -2,6 +2,6 @@ import pytest
class TestGeoiplookup:
- @pytest.mark.complete("geoiplookup -")
+ @pytest.mark.complete("geoiplookup -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_getconf.py b/test/t/test_getconf.py
index 6f9192d2..c80c803e 100644
--- a/test/t/test_getconf.py
+++ b/test/t/test_getconf.py
@@ -14,7 +14,9 @@ class TestGetconf:
def test_3(self, completion):
assert completion
- @pytest.mark.complete("getconf -v ")
+ @pytest.mark.complete(
+ "getconf -v ", xfail="! getconf -a 2>&1 | command grep -q ^POSIX_V"
+ )
def test_4(self, completion):
assert completion
diff --git a/test/t/test_getent.py b/test/t/test_getent.py
index fa84880c..a1e9fcbb 100644
--- a/test/t/test_getent.py
+++ b/test/t/test_getent.py
@@ -5,3 +5,14 @@ class TestGetent:
@pytest.mark.complete("getent ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete(
+ "getent -",
+ require_cmd=True,
+ xfail=(
+ "! (getent --help 2>&1 || :) | "
+ "command grep -q -- '[[:space:]]-'"
+ ),
+ )
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_gkrellm.py b/test/t/test_gkrellm.py
index 8ab4b5a7..fdc2e165 100644
--- a/test/t/test_gkrellm.py
+++ b/test/t/test_gkrellm.py
@@ -5,6 +5,6 @@ import pytest
@pytest.mark.xfail(not os.environ.get("DISPLAY"), reason="X display required")
class TestGkrellm:
- @pytest.mark.complete("gkrellm -")
+ @pytest.mark.complete("gkrellm -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_gm.py b/test/t/test_gm.py
index 82d16702..9cdd73c4 100644
--- a/test/t/test_gm.py
+++ b/test/t/test_gm.py
@@ -2,15 +2,15 @@ import pytest
class TestGm:
- @pytest.mark.complete("gm ")
+ @pytest.mark.complete("gm ", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("gm help ")
+ @pytest.mark.complete("gm help ", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("gm time ")
+ @pytest.mark.complete("gm time ", require_cmd=True)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_gnokii.py b/test/t/test_gnokii.py
index 106005f9..66af6e99 100644
--- a/test/t/test_gnokii.py
+++ b/test/t/test_gnokii.py
@@ -2,6 +2,10 @@ import pytest
class TestGnokii:
- @pytest.mark.complete("gnokii ")
+ @pytest.mark.complete("gnokii ", require_cmd=True)
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("gnokii -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_gnome_mplayer.py b/test/t/test_gnome_mplayer.py
index 5ee952c1..379c56ce 100644
--- a/test/t/test_gnome_mplayer.py
+++ b/test/t/test_gnome_mplayer.py
@@ -1,8 +1,17 @@
import pytest
-@pytest.mark.bashcomp(cmd="gnome-mplayer")
+@pytest.mark.bashcomp(cmd="gnome-mplayer", ignore_env=r"^[+-]XDG_DATA_DIRS=")
class TestGnomeMplayer:
@pytest.mark.complete("gnome-mplayer ")
def test_1(self, completion):
assert completion
+
+ # XDG_DATA_DIRS set to a dir with no schemas results in
+ # "GLib-GIO-ERROR **: No GSettings schemas are installed on the system"
+ # and a core dump on --help on Ubuntu 14.
+ @pytest.mark.complete(
+ "gnome-mplayer -", require_cmd=True, pre_cmds=("unset XDG_DATA_DIRS",)
+ )
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_gnome_screenshot.py b/test/t/test_gnome_screenshot.py
index 476f57f1..977e03fb 100644
--- a/test/t/test_gnome_screenshot.py
+++ b/test/t/test_gnome_screenshot.py
@@ -3,6 +3,6 @@ import pytest
@pytest.mark.bashcomp(cmd="gnome-screenshot")
class TestGnomeScreenshot:
- @pytest.mark.complete("gnome-screenshot --help")
+ @pytest.mark.complete("gnome-screenshot --help", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_gpasswd.py b/test/t/test_gpasswd.py
index 43826a58..4f0221b9 100644
--- a/test/t/test_gpasswd.py
+++ b/test/t/test_gpasswd.py
@@ -5,3 +5,7 @@ class TestGpasswd:
@pytest.mark.complete("gpasswd ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("gpasswd -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_gperf.py b/test/t/test_gperf.py
index f8267bf7..54f75b18 100644
--- a/test/t/test_gperf.py
+++ b/test/t/test_gperf.py
@@ -2,6 +2,6 @@ import pytest
class TestGperf:
- @pytest.mark.complete("gperf --")
+ @pytest.mark.complete("gperf --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_gpg2.py b/test/t/test_gpg2.py
index 6a7ff333..27a39faf 100644
--- a/test/t/test_gpg2.py
+++ b/test/t/test_gpg2.py
@@ -2,6 +2,6 @@ import pytest
class TestGpg2:
- @pytest.mark.complete("gpg2 --h")
+ @pytest.mark.complete("gpg2 --h", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_gpgv.py b/test/t/test_gpgv.py
index 05feb71f..d600c74f 100644
--- a/test/t/test_gpgv.py
+++ b/test/t/test_gpgv.py
@@ -6,7 +6,7 @@ class TestGpgv:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("gpgv -")
+ @pytest.mark.complete("gpgv -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_gphoto2.py b/test/t/test_gphoto2.py
index 830e6f6f..bb987f7e 100644
--- a/test/t/test_gphoto2.py
+++ b/test/t/test_gphoto2.py
@@ -2,6 +2,6 @@ import pytest
class TestGphoto2:
- @pytest.mark.complete("gphoto2 --")
+ @pytest.mark.complete("gphoto2 --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_gprof.py b/test/t/test_gprof.py
index 417e0914..a30cc1e7 100644
--- a/test/t/test_gprof.py
+++ b/test/t/test_gprof.py
@@ -2,6 +2,6 @@ import pytest
class TestGprof:
- @pytest.mark.complete("gprof --", skipif="! gprof --help &>/dev/null")
+ @pytest.mark.complete("gprof --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_grep.py b/test/t/test_grep.py
index d7d742ec..a249122e 100644
--- a/test/t/test_grep.py
+++ b/test/t/test_grep.py
@@ -2,7 +2,7 @@ import pytest
class TestGrep:
- @pytest.mark.complete("grep --")
+ @pytest.mark.complete("grep --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_groupadd.py b/test/t/test_groupadd.py
index efea4677..f882d1ed 100644
--- a/test/t/test_groupadd.py
+++ b/test/t/test_groupadd.py
@@ -6,6 +6,6 @@ class TestGroupadd:
def test_1(self, completion):
assert not completion
- @pytest.mark.complete("groupadd -")
+ @pytest.mark.complete("groupadd -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_groupdel.py b/test/t/test_groupdel.py
index 1409e6cc..6e558395 100644
--- a/test/t/test_groupdel.py
+++ b/test/t/test_groupdel.py
@@ -5,3 +5,7 @@ class TestGroupdel:
@pytest.mark.complete("groupdel ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("groupdel -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_groupmems.py b/test/t/test_groupmems.py
index 2faff633..c7b99208 100644
--- a/test/t/test_groupmems.py
+++ b/test/t/test_groupmems.py
@@ -2,6 +2,6 @@ import pytest
class TestGroupmems:
- @pytest.mark.complete("groupmems -")
+ @pytest.mark.complete("groupmems -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_groupmod.py b/test/t/test_groupmod.py
index 08b1d2e2..7097118f 100644
--- a/test/t/test_groupmod.py
+++ b/test/t/test_groupmod.py
@@ -6,6 +6,6 @@ class TestGroupmod:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("groupmod -")
+ @pytest.mark.complete("groupmod -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_grpck.py b/test/t/test_grpck.py
index 0d6a5cef..dcd14850 100644
--- a/test/t/test_grpck.py
+++ b/test/t/test_grpck.py
@@ -6,6 +6,6 @@ class TestGrpck:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("grpck -")
+ @pytest.mark.complete("grpck -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_grub.py b/test/t/test_grub.py
index 8ecd0209..4a6929ff 100644
--- a/test/t/test_grub.py
+++ b/test/t/test_grub.py
@@ -2,6 +2,6 @@ import pytest
class TestGrub:
- @pytest.mark.complete("grub --")
+ @pytest.mark.complete("grub --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_gssdp_discover.py b/test/t/test_gssdp_discover.py
new file mode 100644
index 00000000..b5451496
--- /dev/null
+++ b/test/t/test_gssdp_discover.py
@@ -0,0 +1,22 @@
+import pytest
+
+
+@pytest.mark.bashcomp(cmd="gssdp-discover")
+class TestGssdpDiscover:
+ @pytest.mark.complete("gssdp-discover ")
+ def test_no_args(self, completion):
+ assert not completion
+
+ @pytest.mark.complete("gssdp-discover --", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
+
+ @pytest.mark.complete(
+ "gssdp-discover --message-type=",
+ skipif=(
+ "! gssdp-discover --help 2>&1 "
+ "| command grep -qF -- --message-type"
+ ),
+ )
+ def test_message_type(self, completion):
+ assert completion
diff --git a/test/t/test_gzip.py b/test/t/test_gzip.py
index 3c2ecb6f..2173cad9 100644
--- a/test/t/test_gzip.py
+++ b/test/t/test_gzip.py
@@ -9,3 +9,7 @@ class TestGzip:
@pytest.mark.complete("gzip ~")
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("gzip -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_hcitool.py b/test/t/test_hcitool.py
index 8725533f..08853855 100644
--- a/test/t/test_hcitool.py
+++ b/test/t/test_hcitool.py
@@ -5,3 +5,7 @@ class TestHcitool:
@pytest.mark.complete("hcitool ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("hcitool -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_head.py b/test/t/test_head.py
index a287034a..815b938c 100644
--- a/test/t/test_head.py
+++ b/test/t/test_head.py
@@ -2,6 +2,6 @@ import pytest
class TestHead:
- @pytest.mark.complete("head --", skipif="! head --help &>/dev/null")
+ @pytest.mark.complete("head --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_hexdump.py b/test/t/test_hexdump.py
index 82b6d2ba..03a7b1f2 100644
--- a/test/t/test_hexdump.py
+++ b/test/t/test_hexdump.py
@@ -2,6 +2,6 @@ import pytest
class TestHexdump:
- @pytest.mark.complete("hexdump -")
+ @pytest.mark.complete("hexdump -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_host.py b/test/t/test_host.py
index 555a36f5..2ef17908 100644
--- a/test/t/test_host.py
+++ b/test/t/test_host.py
@@ -2,6 +2,6 @@ import pytest
class TestHost:
- @pytest.mark.complete("host -")
+ @pytest.mark.complete("host -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_hostname.py b/test/t/test_hostname.py
index 5ccdf458..f644c1ea 100644
--- a/test/t/test_hostname.py
+++ b/test/t/test_hostname.py
@@ -2,6 +2,6 @@ import pytest
class TestHostname:
- @pytest.mark.complete("hostname -")
+ @pytest.mark.complete("hostname -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_hping2.py b/test/t/test_hping2.py
index 77e2ee26..19665ba3 100644
--- a/test/t/test_hping2.py
+++ b/test/t/test_hping2.py
@@ -5,3 +5,7 @@ class TestHping2:
@pytest.mark.complete("hping2 ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("hping2 -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_htop.py b/test/t/test_htop.py
index 62022bbd..e837c5ad 100644
--- a/test/t/test_htop.py
+++ b/test/t/test_htop.py
@@ -2,6 +2,6 @@ import pytest
class TestHtop:
- @pytest.mark.complete("htop -")
+ @pytest.mark.complete("htop -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_htpasswd.py b/test/t/test_htpasswd.py
index c17c0585..92989fa2 100644
--- a/test/t/test_htpasswd.py
+++ b/test/t/test_htpasswd.py
@@ -17,3 +17,7 @@ class TestHtpasswd:
@pytest.mark.complete("htpasswd -D htpasswd ", cwd="htpasswd")
def test_4(self, completion):
assert completion == "foo quux".split()
+
+ @pytest.mark.complete("htpasswd -", require_cmd=True)
+ def test_5(self, completion):
+ assert completion
diff --git a/test/t/test_hunspell.py b/test/t/test_hunspell.py
index 94ea1020..0f27185c 100644
--- a/test/t/test_hunspell.py
+++ b/test/t/test_hunspell.py
@@ -6,6 +6,6 @@ class TestHunspell:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("hunspell -")
+ @pytest.mark.complete("hunspell -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_hwclock.py b/test/t/test_hwclock.py
index a9cb30fa..47172103 100644
--- a/test/t/test_hwclock.py
+++ b/test/t/test_hwclock.py
@@ -2,6 +2,6 @@ import pytest
class TestHwclock:
- @pytest.mark.complete("hwclock -")
+ @pytest.mark.complete("hwclock -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py
index dc5f8961..f42a87fe 100644
--- a/test/t/test_iconv.py
+++ b/test/t/test_iconv.py
@@ -2,10 +2,20 @@ import pytest
class TestIconv:
- @pytest.mark.complete("iconv -")
+ @pytest.mark.complete(
+ "iconv -", require_cmd=True, xfail="! iconv --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
- @pytest.mark.complete("iconv -f UTF")
+ @pytest.mark.complete("iconv -f UTF", require_cmd=True)
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("iconv ")
+ def test_3(self, completion):
+ assert completion
+
+ @pytest.mark.complete("iconv -f ")
+ def test_4(self, completion):
+ assert "..." not in completion
diff --git a/test/t/test_identify.py b/test/t/test_identify.py
index 12fba008..34ae2854 100644
--- a/test/t/test_identify.py
+++ b/test/t/test_identify.py
@@ -2,6 +2,6 @@ import pytest
class TestIdentify:
- @pytest.mark.complete("identify -")
+ @pytest.mark.complete("identify -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_idn.py b/test/t/test_idn.py
index 1fd1ce02..78172c0a 100644
--- a/test/t/test_idn.py
+++ b/test/t/test_idn.py
@@ -2,6 +2,6 @@ import pytest
class TestIdn:
- @pytest.mark.complete("idn -")
+ @pytest.mark.complete("idn -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ifdown.py b/test/t/test_ifdown.py
index 16447be5..e91e4bac 100644
--- a/test/t/test_ifdown.py
+++ b/test/t/test_ifdown.py
@@ -1,10 +1,10 @@
import pytest
-from conftest import in_docker
+from conftest import in_container
class TestIfdown:
- @pytest.mark.xfail(in_docker(), reason="Probably fails in docker")
+ @pytest.mark.xfail(in_container(), reason="Probably fails in a container")
@pytest.mark.complete("ifdown ")
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ifstat.py b/test/t/test_ifstat.py
index e4d828ee..89b5a0ec 100644
--- a/test/t/test_ifstat.py
+++ b/test/t/test_ifstat.py
@@ -2,18 +2,20 @@ import pytest
class TestIfstat:
- @pytest.mark.complete("ifstat -")
+ @pytest.mark.complete("ifstat -", require_cmd=True)
def test_1(self, completion):
assert completion
@pytest.mark.complete(
- "ifstat -i ", skipif="ifstat -v | command grep -qF iproute2"
+ "ifstat -i ", xfail="ifstat -v | command grep -qF iproute2"
)
def test_2(self, completion):
assert completion
@pytest.mark.complete(
- "ifstat -d ", skipif="ifstat -v | command grep -qF iproute2"
+ "ifstat -d ",
+ require_cmd=True,
+ xfail="ifstat -v | command grep -qF iproute2",
)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_iftop.py b/test/t/test_iftop.py
index 9a25c28a..44973105 100644
--- a/test/t/test_iftop.py
+++ b/test/t/test_iftop.py
@@ -2,6 +2,10 @@ import pytest
class TestIftop:
- @pytest.mark.complete("iftop ")
+ @pytest.mark.complete("iftop ", require_cmd=True)
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("iftop -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_ifup.py b/test/t/test_ifup.py
index 62d8eb4a..843190e4 100644
--- a/test/t/test_ifup.py
+++ b/test/t/test_ifup.py
@@ -1,15 +1,17 @@
import pytest
-from conftest import in_docker
+from conftest import in_container
class TestIfup:
- @pytest.mark.xfail(in_docker(), reason="Probably fails in docker")
+ @pytest.mark.xfail(in_container(), reason="Probably fails in a container")
@pytest.mark.complete("ifup ")
def test_1(self, completion):
assert completion
- @pytest.mark.complete("ifup --", skipif="! ifup --help &>/dev/null")
+ @pytest.mark.complete(
+ "ifup -", require_cmd=True, skipif="! ifup --help &>/dev/null"
+ )
def test_2(self, completion):
assert completion
diff --git a/test/t/test_influx.py b/test/t/test_influx.py
new file mode 100644
index 00000000..53a15bff
--- /dev/null
+++ b/test/t/test_influx.py
@@ -0,0 +1,15 @@
+import pytest
+
+
+class TestInflux:
+ @pytest.mark.complete("influx ")
+ def test_nothing(self, completion):
+ assert not completion
+
+ @pytest.mark.complete("influx -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
+
+ @pytest.mark.complete("influx -format ", require_cmd=True)
+ def test_format(self, completion):
+ assert completion
diff --git a/test/t/test_info.py b/test/t/test_info.py
index b52b682e..e12d900f 100644
--- a/test/t/test_info.py
+++ b/test/t/test_info.py
@@ -7,6 +7,6 @@ class TestInfo:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("info -")
+ @pytest.mark.complete("info -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_inotifywait.py b/test/t/test_inotifywait.py
index fe647ad6..19fa4d54 100644
--- a/test/t/test_inotifywait.py
+++ b/test/t/test_inotifywait.py
@@ -6,10 +6,10 @@ class TestInotifywait:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("inotifywait --")
+ @pytest.mark.complete("inotifywait --", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("inotifywait -e ")
+ @pytest.mark.complete("inotifywait -e ", require_cmd=True)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_inotifywatch.py b/test/t/test_inotifywatch.py
index e0e686e8..281fec49 100644
--- a/test/t/test_inotifywatch.py
+++ b/test/t/test_inotifywatch.py
@@ -6,10 +6,10 @@ class TestInotifywatch:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("inotifywatch --")
+ @pytest.mark.complete("inotifywatch --", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("inotifywatch -e ")
+ @pytest.mark.complete("inotifywatch -e ", require_cmd=True)
def test_3(self, completion):
assert len(completion) > 1
diff --git a/test/t/test_installpkg.py b/test/t/test_installpkg.py
index 4e5ab27c..e665f523 100644
--- a/test/t/test_installpkg.py
+++ b/test/t/test_installpkg.py
@@ -21,18 +21,18 @@ class TestInstallpkg:
dirs = sorted(x for x in os.listdir(".") if os.path.isdir("./%s" % x))
assert completion == ["%s/" % x for x in dirs]
- @pytest.mark.complete("installpkg --root ")
+ @pytest.mark.complete("installpkg ", cwd="slackware/home")
def test_4(self, completion):
expected = sorted(
[
"%s/" % x
for x in os.listdir("slackware/home")
- if os.path.isdir("./%s" % x)
+ if os.path.isdir("./slackware/home/%s" % x)
]
+ [
x
for x in os.listdir("slackware/home")
- if os.path.isfile("./%s" % x)
+ if os.path.isfile("./slackware/home/%s" % x)
and fnmatch.fnmatch(x, "*.t[bglx]z")
]
)
diff --git a/test/t/test_interdiff.py b/test/t/test_interdiff.py
index e681fd6c..83be115e 100644
--- a/test/t/test_interdiff.py
+++ b/test/t/test_interdiff.py
@@ -5,3 +5,7 @@ class TestInterdiff:
@pytest.mark.complete("interdiff ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("interdiff -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_ionice.py b/test/t/test_ionice.py
index ae047043..b097ebe0 100644
--- a/test/t/test_ionice.py
+++ b/test/t/test_ionice.py
@@ -2,6 +2,6 @@ import pytest
class TestIonice:
- @pytest.mark.complete("ionice -")
+ @pytest.mark.complete("ionice -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_iperf.py b/test/t/test_iperf.py
index 23f4df55..c38e9546 100644
--- a/test/t/test_iperf.py
+++ b/test/t/test_iperf.py
@@ -2,7 +2,7 @@ import pytest
class TestIperf:
- @pytest.mark.complete("iperf ")
+ @pytest.mark.complete("iperf ", require_cmd=True)
def test_1(self, completion):
assert completion
@@ -10,11 +10,15 @@ class TestIperf:
def test_2(self, completion):
assert completion
- @pytest.mark.complete("iperf --client foo --")
+ @pytest.mark.complete("iperf --client foo --", require_cmd=True)
def test_3(self, completion):
assert completion
assert "--daemon" not in completion
- @pytest.mark.complete("iperf --server --")
+ @pytest.mark.complete("iperf --server --", require_cmd=True)
def test_4(self, completion):
assert "--daemon" in completion
+
+ @pytest.mark.complete("iperf -", require_cmd=True)
+ def test_5(self, completion):
+ assert completion
diff --git a/test/t/test_iperf3.py b/test/t/test_iperf3.py
index cd93a996..15f3a03b 100644
--- a/test/t/test_iperf3.py
+++ b/test/t/test_iperf3.py
@@ -2,7 +2,7 @@ import pytest
class TestIperf3:
- @pytest.mark.complete("iperf3 ")
+ @pytest.mark.complete("iperf3 ", require_cmd=True)
def test_1(self, completion):
assert completion
@@ -10,11 +10,11 @@ class TestIperf3:
def test_2(self, completion):
assert completion
- @pytest.mark.complete("iperf3 --client foo --")
+ @pytest.mark.complete("iperf3 --client foo --", require_cmd=True)
def test_3(self, completion):
assert completion
assert "--daemon" not in completion
- @pytest.mark.complete("iperf3 --server --")
+ @pytest.mark.complete("iperf3 --server --", require_cmd=True)
def test_4(self, completion):
assert "--daemon" in completion
diff --git a/test/t/test_ipmitool.py b/test/t/test_ipmitool.py
index 5f50ec79..f779f910 100644
--- a/test/t/test_ipmitool.py
+++ b/test/t/test_ipmitool.py
@@ -5,3 +5,7 @@ class TestIpmitool:
@pytest.mark.complete("ipmitool ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("ipmitool -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_iptables.py b/test/t/test_iptables.py
index 7a30bb82..a5c82e5a 100644
--- a/test/t/test_iptables.py
+++ b/test/t/test_iptables.py
@@ -2,6 +2,6 @@ import pytest
class TestIptables:
- @pytest.mark.complete("iptables -")
+ @pytest.mark.complete("iptables -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ipv6calc.py b/test/t/test_ipv6calc.py
index 435af149..872d8a37 100644
--- a/test/t/test_ipv6calc.py
+++ b/test/t/test_ipv6calc.py
@@ -2,10 +2,10 @@ import pytest
class TestIpv6calc:
- @pytest.mark.complete("ipv6calc -")
+ @pytest.mark.complete("ipv6calc -", require_cmd=True)
def test_1(self, completion):
- assert completion
+ assert "--action" in completion
- @pytest.mark.complete("ipv6calc --in ")
+ @pytest.mark.complete("ipv6calc --in ", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_irb.py b/test/t/test_irb.py
index 31c46e20..03a83c66 100644
--- a/test/t/test_irb.py
+++ b/test/t/test_irb.py
@@ -5,3 +5,7 @@ class TestIrb:
@pytest.mark.complete("irb ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("irb -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_isort.py b/test/t/test_isort.py
index 4fae3244..9f7a6524 100644
--- a/test/t/test_isort.py
+++ b/test/t/test_isort.py
@@ -6,6 +6,6 @@ class TestIsort:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("isort -")
+ @pytest.mark.complete("isort -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_java.py b/test/t/test_java.py
index 81f07c68..ce0f7733 100644
--- a/test/t/test_java.py
+++ b/test/t/test_java.py
@@ -1,25 +1,44 @@
import pytest
+from conftest import is_bash_type
+
@pytest.mark.bashcomp(
pre_cmds=("CLASSPATH=$PWD/java/a:$PWD/java/bashcomp.jar",)
)
class TestJava:
- @pytest.mark.complete("java -")
+ @pytest.fixture(scope="class")
+ def can_list_jar(self, bash):
+ return (
+ is_bash_type(bash, "zipinfo")
+ or is_bash_type(bash, "unzip")
+ or is_bash_type(bash, "jar")
+ )
+
+ @pytest.mark.complete("java -", require_cmd=True)
def test_1(self, completion):
assert completion
@pytest.mark.complete("java ")
- def test_2(self, completion):
- assert completion == "b bashcomp.jarred c. toplevel".split()
+ def test_2(self, completion, can_list_jar):
+ if can_list_jar:
+ assert completion == "b bashcomp.jarred c. toplevel".split()
+ else:
+ assert completion == "b c.".split()
@pytest.mark.complete("java -classpath java/bashcomp.jar ")
- def test_3(self, completion):
- assert completion == "bashcomp.jarred toplevel".split()
+ def test_3(self, completion, can_list_jar):
+ if can_list_jar:
+ assert completion == "bashcomp.jarred toplevel".split()
+ else:
+ assert not completion
@pytest.mark.complete("java -cp java/bashcomp.jar:java/a/c ")
- def test_4(self, completion):
- assert completion == "bashcomp.jarred d toplevel".split()
+ def test_4(self, completion, can_list_jar):
+ if can_list_jar:
+ assert completion == "bashcomp.jarred d toplevel".split()
+ else:
+ assert completion == ["d"]
@pytest.mark.complete("java -cp '' ")
def test_5(self, completion):
diff --git a/test/t/test_javaws.py b/test/t/test_javaws.py
index 9f51c58b..596c7352 100644
--- a/test/t/test_javaws.py
+++ b/test/t/test_javaws.py
@@ -5,3 +5,7 @@ class TestJavaws:
@pytest.mark.complete("javaws ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("javaws -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_jpegoptim.py b/test/t/test_jpegoptim.py
index 01eb739c..fb525910 100644
--- a/test/t/test_jpegoptim.py
+++ b/test/t/test_jpegoptim.py
@@ -5,3 +5,7 @@ class TestJpegoptim:
@pytest.mark.complete("jpegoptim ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("jpegoptim -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_jq.py b/test/t/test_jq.py
index c858411f..47014143 100644
--- a/test/t/test_jq.py
+++ b/test/t/test_jq.py
@@ -12,8 +12,7 @@ class TestJq:
@pytest.mark.complete(
"jq -",
- skipif="! (jq --help 2>&1 || :) | "
- "command grep -qF 'options include'",
+ xfail="! (jq --help 2>&1 || :) | command grep -qF 'options include'",
)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_jshint.py b/test/t/test_jshint.py
index 511e7c9d..58049d14 100644
--- a/test/t/test_jshint.py
+++ b/test/t/test_jshint.py
@@ -5,3 +5,7 @@ class TestJshint:
@pytest.mark.complete("jshint ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("jshint -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_jsonschema.py b/test/t/test_jsonschema.py
index 0905fd7f..9e3929e6 100644
--- a/test/t/test_jsonschema.py
+++ b/test/t/test_jsonschema.py
@@ -6,6 +6,6 @@ class TestJsonschema:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("jsonschema -")
+ @pytest.mark.complete("jsonschema -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_k3b.py b/test/t/test_k3b.py
index d9940ba5..61b6a4d5 100644
--- a/test/t/test_k3b.py
+++ b/test/t/test_k3b.py
@@ -5,3 +5,7 @@ class TestK3b:
@pytest.mark.complete("k3b ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("k3b -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_kcov.py b/test/t/test_kcov.py
index ce985a78..3c7d3dfa 100644
--- a/test/t/test_kcov.py
+++ b/test/t/test_kcov.py
@@ -6,7 +6,7 @@ class TestKcov:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("kcov --exclude-patter")
+ @pytest.mark.complete("kcov --exclude-patter", require_cmd=True)
def test_2(self, completion):
assert completion == "--exclude-pattern="
assert completion.endswith("=")
diff --git a/test/t/test_kdvi.py b/test/t/test_kdvi.py
index 7fb11cb0..c2ab011a 100644
--- a/test/t/test_kdvi.py
+++ b/test/t/test_kdvi.py
@@ -4,7 +4,7 @@ import pytest
class TestKdvi:
@pytest.mark.complete("kdvi ", cwd="kdvi")
def test_1(self, completion):
- assert (
- completion == "foo/ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz "
+ assert completion == sorted(
+ "foo/ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz "
".DVI.gz .dvi.Z .DVI.Z".split()
)
diff --git a/test/t/test_kill.py b/test/t/test_kill.py
index 59d5fa2b..9699435c 100644
--- a/test/t/test_kill.py
+++ b/test/t/test_kill.py
@@ -2,7 +2,7 @@ import pytest
class TestKill:
- @pytest.mark.complete("kill 1", skipif="! type ps &>/dev/null")
+ @pytest.mark.complete("kill 1", xfail="! type ps &>/dev/null")
def test_1(self, completion):
assert completion
diff --git a/test/t/test_killall.py b/test/t/test_killall.py
index 725a16e4..4b67d961 100644
--- a/test/t/test_killall.py
+++ b/test/t/test_killall.py
@@ -11,3 +11,11 @@ class TestKillall:
@pytest.mark.complete("killall --signal ")
def test_2(self, completion):
assert all(x in completion for x in "INT KILL TERM".split())
+
+ @pytest.mark.complete("killall ")
+ def test_3(self, completion):
+ assert "command=" not in completion
+
+ @pytest.mark.complete("killall -", require_cmd=True)
+ def test_4(self, completion):
+ assert completion
diff --git a/test/t/test_koji.py b/test/t/test_koji.py
index 68a8477b..73d3e4c2 100644
--- a/test/t/test_koji.py
+++ b/test/t/test_koji.py
@@ -2,10 +2,10 @@ import pytest
class TestKoji:
- @pytest.mark.complete("koji ")
+ @pytest.mark.complete("koji ", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("koji -")
+ @pytest.mark.complete("koji -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_kpdf.py b/test/t/test_kpdf.py
index ceee34d3..68b36fe8 100644
--- a/test/t/test_kpdf.py
+++ b/test/t/test_kpdf.py
@@ -4,4 +4,4 @@ import pytest
class TestKpdf:
@pytest.mark.complete("kpdf ", cwd="kpdf")
def test_1(self, completion):
- assert completion == "foo/ .eps .ps .EPS .PS .pdf .PDF".split()
+ assert completion == sorted("foo/ .eps .ps .EPS .PS .pdf .PDF".split())
diff --git a/test/t/test_l2ping.py b/test/t/test_l2ping.py
index 7979d734..c50651b7 100644
--- a/test/t/test_l2ping.py
+++ b/test/t/test_l2ping.py
@@ -2,6 +2,6 @@ import pytest
class TestL2ping:
- @pytest.mark.complete("l2ping -")
+ @pytest.mark.complete("l2ping -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lastlog.py b/test/t/test_lastlog.py
index 043af962..31a855fb 100644
--- a/test/t/test_lastlog.py
+++ b/test/t/test_lastlog.py
@@ -2,6 +2,6 @@ import pytest
class TestLastlog:
- @pytest.mark.complete("lastlog -")
+ @pytest.mark.complete("lastlog -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ld.py b/test/t/test_ld.py
index a82f091b..f6a16bb2 100644
--- a/test/t/test_ld.py
+++ b/test/t/test_ld.py
@@ -5,3 +5,7 @@ class TestLd:
@pytest.mark.complete("ld ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("ld -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_ldapvi.py b/test/t/test_ldapvi.py
index a81ae180..5e65fc46 100644
--- a/test/t/test_ldapvi.py
+++ b/test/t/test_ldapvi.py
@@ -2,6 +2,6 @@ import pytest
class TestLdapvi:
- @pytest.mark.complete("ldapvi -")
+ @pytest.mark.complete("ldapvi -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ldd.py b/test/t/test_ldd.py
index 8c463b60..70e295a5 100644
--- a/test/t/test_ldd.py
+++ b/test/t/test_ldd.py
@@ -5,3 +5,7 @@ class TestLdd:
@pytest.mark.complete("ldd ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("ldd -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_less.py b/test/t/test_less.py
index 79cdf183..0b14e21e 100644
--- a/test/t/test_less.py
+++ b/test/t/test_less.py
@@ -2,6 +2,6 @@ import pytest
class TestLess:
- @pytest.mark.complete("less --")
+ @pytest.mark.complete("less --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lftp.py b/test/t/test_lftp.py
index 18506f61..765e51e1 100644
--- a/test/t/test_lftp.py
+++ b/test/t/test_lftp.py
@@ -12,3 +12,7 @@ class TestLftp:
).split()
assert all(x in completion for x in hosts)
assert "lftptest" in completion # defined in lftp/.lftp/bookmarks
+
+ @pytest.mark.complete("lftp -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_links.py b/test/t/test_links.py
index f21b8728..0806813d 100644
--- a/test/t/test_links.py
+++ b/test/t/test_links.py
@@ -6,6 +6,6 @@ class TestLinks:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("links -")
+ @pytest.mark.complete("links -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_lintian_info.py b/test/t/test_lintian_info.py
index 6bcc9e52..bf9afc52 100644
--- a/test/t/test_lintian_info.py
+++ b/test/t/test_lintian_info.py
@@ -7,6 +7,6 @@ class TestLintianInfo:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("lintian-info --")
+ @pytest.mark.complete("lintian-info --", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_ln.py b/test/t/test_ln.py
index de053345..6bf809c6 100644
--- a/test/t/test_ln.py
+++ b/test/t/test_ln.py
@@ -5,3 +5,7 @@ class TestLn:
@pytest.mark.complete("ln ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("ln -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_locale_gen.py b/test/t/test_locale_gen.py
index 41ac376f..caffb067 100644
--- a/test/t/test_locale_gen.py
+++ b/test/t/test_locale_gen.py
@@ -3,10 +3,11 @@ import pytest
@pytest.mark.bashcomp(cmd="locale-gen")
class TestLocaleGen:
- @pytest.mark.complete("locale-gen ")
+ # require_cmd is not strictly true here, but...
+ @pytest.mark.complete("locale-gen ", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("locale-gen --")
+ @pytest.mark.complete("locale-gen --", require_longopt=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_lrzip.py b/test/t/test_lrzip.py
index 266d8a30..d61ee9d1 100644
--- a/test/t/test_lrzip.py
+++ b/test/t/test_lrzip.py
@@ -9,3 +9,7 @@ class TestLrzip:
@pytest.mark.complete("lrzip ~")
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("lrzip -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_ls.py b/test/t/test_ls.py
index ed5ad9c4..7e2d1f35 100644
--- a/test/t/test_ls.py
+++ b/test/t/test_ls.py
@@ -8,7 +8,9 @@ from conftest import (
class TestLs:
- @pytest.mark.complete("ls --", skipif="! ls --help &>/dev/null")
+ @pytest.mark.complete(
+ "ls --", require_cmd=True, xfail="! ls --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lspci.py b/test/t/test_lspci.py
index 44663426..ac18da3f 100644
--- a/test/t/test_lspci.py
+++ b/test/t/test_lspci.py
@@ -2,10 +2,10 @@ import pytest
class TestLspci:
- @pytest.mark.complete("lspci -")
+ @pytest.mark.complete("lspci -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("lspci -A ")
+ @pytest.mark.complete("lspci -A ", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_lsscsi.py b/test/t/test_lsscsi.py
index a297b375..fe01ac15 100644
--- a/test/t/test_lsscsi.py
+++ b/test/t/test_lsscsi.py
@@ -6,6 +6,6 @@ class TestLsscsi:
def test_1(self, completion):
assert not completion
- @pytest.mark.complete("lsscsi -")
+ @pytest.mark.complete("lsscsi -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_lsusb.py b/test/t/test_lsusb.py
index 9c546d32..c68d046b 100644
--- a/test/t/test_lsusb.py
+++ b/test/t/test_lsusb.py
@@ -2,6 +2,9 @@ import pytest
class TestLsusb:
- @pytest.mark.complete("lsusb -")
+ @pytest.mark.complete(
+ "lsusb -",
+ xfail="! (lsusb --help 2>&1 || :) | command grep -qF -- --help",
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lua.py b/test/t/test_lua.py
index edcae883..54c24321 100644
--- a/test/t/test_lua.py
+++ b/test/t/test_lua.py
@@ -5,3 +5,7 @@ class TestLua:
@pytest.mark.complete("lua ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("lua -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_luac.py b/test/t/test_luac.py
index f14d400a..28dc0e85 100644
--- a/test/t/test_luac.py
+++ b/test/t/test_luac.py
@@ -5,3 +5,7 @@ class TestLuac:
@pytest.mark.complete("luac ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("luac -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_luseradd.py b/test/t/test_luseradd.py
index 35c89e54..4f1bec9c 100644
--- a/test/t/test_luseradd.py
+++ b/test/t/test_luseradd.py
@@ -2,6 +2,6 @@ import pytest
class TestLuseradd:
- @pytest.mark.complete("luseradd -")
+ @pytest.mark.complete("luseradd -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_luserdel.py b/test/t/test_luserdel.py
index cdca2a57..ad88557c 100644
--- a/test/t/test_luserdel.py
+++ b/test/t/test_luserdel.py
@@ -5,3 +5,7 @@ class TestLuserdel:
@pytest.mark.complete("luserdel ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("luserdel -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_lvchange.py b/test/t/test_lvchange.py
index 5722a581..3e4feda5 100644
--- a/test/t/test_lvchange.py
+++ b/test/t/test_lvchange.py
@@ -3,7 +3,7 @@ import pytest
class TestLvchange:
@pytest.mark.complete(
- "lvchange --", skipif="! lvchange --help &>/dev/null"
+ "lvchange --", require_cmd=True, xfail="! lvchange --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvcreate.py b/test/t/test_lvcreate.py
index e60432f6..636f6250 100644
--- a/test/t/test_lvcreate.py
+++ b/test/t/test_lvcreate.py
@@ -3,7 +3,7 @@ import pytest
class TestLvcreate:
@pytest.mark.complete(
- "lvcreate --", skipif="! lvcreate --help &>/dev/null"
+ "lvcreate --", require_cmd=True, xfail="! lvcreate --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvdisplay.py b/test/t/test_lvdisplay.py
index e9a955ed..52106621 100644
--- a/test/t/test_lvdisplay.py
+++ b/test/t/test_lvdisplay.py
@@ -3,7 +3,9 @@ import pytest
class TestLvdisplay:
@pytest.mark.complete(
- "lvdisplay --", skipif="! lvdisplay --help &>/dev/null"
+ "lvdisplay --",
+ require_cmd=True,
+ xfail="! lvdisplay --help &>/dev/null",
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvextend.py b/test/t/test_lvextend.py
index 68e17848..4daa8887 100644
--- a/test/t/test_lvextend.py
+++ b/test/t/test_lvextend.py
@@ -3,7 +3,7 @@ import pytest
class TestLvextend:
@pytest.mark.complete(
- "lvextend --", skipif="! lvextend --help &>/dev/null"
+ "lvextend --", require_cmd=True, xfail="! lvextend --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvmdiskscan.py b/test/t/test_lvmdiskscan.py
index 0716d5c4..1b334b89 100644
--- a/test/t/test_lvmdiskscan.py
+++ b/test/t/test_lvmdiskscan.py
@@ -3,7 +3,9 @@ import pytest
class TestLvmdiskscan:
@pytest.mark.complete(
- "lvmdiskscan --", skipif="! lvmdiskscan --help &>/dev/null"
+ "lvmdiskscan --",
+ require_cmd=True,
+ xfail="! lvmdiskscan --help &>/dev/null",
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvreduce.py b/test/t/test_lvreduce.py
index 50b038fd..3b614cb9 100644
--- a/test/t/test_lvreduce.py
+++ b/test/t/test_lvreduce.py
@@ -3,7 +3,7 @@ import pytest
class TestLvreduce:
@pytest.mark.complete(
- "lvreduce --", skipif="! lvreduce --help &>/dev/null"
+ "lvreduce --", require_cmd=True, xfail="! lvreduce --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvremove.py b/test/t/test_lvremove.py
index 53950aec..17486aa0 100644
--- a/test/t/test_lvremove.py
+++ b/test/t/test_lvremove.py
@@ -3,7 +3,7 @@ import pytest
class TestLvremove:
@pytest.mark.complete(
- "lvremove --", skipif="! lvremove --help &>/dev/null"
+ "lvremove --", require_cmd=True, xfail="! lvremove --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvrename.py b/test/t/test_lvrename.py
index c60469f5..802b72e7 100644
--- a/test/t/test_lvrename.py
+++ b/test/t/test_lvrename.py
@@ -3,7 +3,7 @@ import pytest
class TestLvrename:
@pytest.mark.complete(
- "lvrename --", skipif="! lvrename --help &>/dev/null"
+ "lvrename --", require_cmd=True, xfail="! lvrename --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvresize.py b/test/t/test_lvresize.py
index aecc8bf4..bb71feb1 100644
--- a/test/t/test_lvresize.py
+++ b/test/t/test_lvresize.py
@@ -3,7 +3,7 @@ import pytest
class TestLvresize:
@pytest.mark.complete(
- "lvresize --", skipif="! lvresize --help &>/dev/null"
+ "lvresize --", require_cmd=True, xfail="! lvresize --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvs.py b/test/t/test_lvs.py
index 456368b9..eadc8df5 100644
--- a/test/t/test_lvs.py
+++ b/test/t/test_lvs.py
@@ -2,6 +2,8 @@ import pytest
class TestLvs:
- @pytest.mark.complete("lvs --", skipif="! lvs --help &>/dev/null")
+ @pytest.mark.complete(
+ "lvs --", require_cmd=True, xfail="! lvs --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lvscan.py b/test/t/test_lvscan.py
index 4848fe4c..a2867b06 100644
--- a/test/t/test_lvscan.py
+++ b/test/t/test_lvscan.py
@@ -2,6 +2,8 @@ import pytest
class TestLvscan:
- @pytest.mark.complete("lvscan --", skipif="! lvscan --help &>/dev/null")
+ @pytest.mark.complete(
+ "lvscan --", require_cmd=True, xfail="! lvscan --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_lz4.py b/test/t/test_lz4.py
index 0d873b66..0e1208c9 100644
--- a/test/t/test_lz4.py
+++ b/test/t/test_lz4.py
@@ -9,3 +9,7 @@ class TestLz4:
@pytest.mark.complete("lz4 ~")
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("lz4 -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_lzip.py b/test/t/test_lzip.py
index 6f1dc023..b0313be4 100644
--- a/test/t/test_lzip.py
+++ b/test/t/test_lzip.py
@@ -5,3 +5,7 @@ class TestLzip:
@pytest.mark.complete("lzip ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("lzip -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_m4.py b/test/t/test_m4.py
index d80a7538..7ecd7745 100644
--- a/test/t/test_m4.py
+++ b/test/t/test_m4.py
@@ -2,6 +2,8 @@ import pytest
class TestM4:
- @pytest.mark.complete("m4 --", skipif="! m4 --help &>/dev/null")
+ @pytest.mark.complete(
+ "m4 --", require_cmd=True, xfail="! m4 --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_macof.py b/test/t/test_macof.py
index 8030c379..17f0eaea 100644
--- a/test/t/test_macof.py
+++ b/test/t/test_macof.py
@@ -2,6 +2,6 @@ import pytest
class TestMacof:
- @pytest.mark.complete("macof -")
+ @pytest.mark.complete("macof -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_mailsnarf.py b/test/t/test_mailsnarf.py
index 4e264a6e..0dc3e04e 100644
--- a/test/t/test_mailsnarf.py
+++ b/test/t/test_mailsnarf.py
@@ -2,6 +2,6 @@ import pytest
class TestMailsnarf:
- @pytest.mark.complete("mailsnarf -")
+ @pytest.mark.complete("mailsnarf -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_make.py b/test/t/test_make.py
index 9c76f83c..e6e043cd 100644
--- a/test/t/test_make.py
+++ b/test/t/test_make.py
@@ -2,7 +2,7 @@ import os
import pytest
-from conftest import in_docker
+from conftest import in_container
class TestMake:
@@ -35,7 +35,7 @@ class TestMake:
os.remove("%s/make/%s" % (bash.cwd, "extra_makefile"))
@pytest.mark.xfail(
- in_docker() and os.environ.get("DIST") == "centos6",
+ in_container() and os.environ.get("DIST") == "centos6",
reason="Fails for some unknown reason on CentOS 6, "
"even though the behavior appears to be correct",
)
@@ -48,3 +48,7 @@ class TestMake:
def test_8(self, bash, completion):
assert completion == "all clean extra_makefile install sample".split()
os.remove("%s/make/%s" % (bash.cwd, "extra_makefile"))
+
+ @pytest.mark.complete("make -", require_cmd=True)
+ def test_9(self, completion):
+ assert completion
diff --git a/test/t/test_makepkg.py b/test/t/test_makepkg.py
index 65f49ea8..f643a292 100644
--- a/test/t/test_makepkg.py
+++ b/test/t/test_makepkg.py
@@ -1,13 +1,16 @@
import pytest
-@pytest.mark.bashcomp(skipif="! makepkg --help 2>&1 | grep -qiF slackware")
+@pytest.mark.bashcomp(
+ ignore_env=r"^-declare -f _makepkg_bootstrap$",
+ xfail="! makepkg --help 2>&1 | command grep -qiF slackware",
+)
class TestMakepkg:
@pytest.mark.complete("makepkg ")
def test_1(self, completion):
assert completion
- @pytest.mark.complete("makepkg --")
+ @pytest.mark.complete("makepkg --", require_cmd=True)
def test_2(self, completion):
assert all(
x in completion for x in "--chown --linkadd --prepend".split()
diff --git a/test/t/test_man.py b/test/t/test_man.py
index 60021d99..ad36d96e 100644
--- a/test/t/test_man.py
+++ b/test/t/test_man.py
@@ -2,10 +2,12 @@ import os
import pytest
-from conftest import assert_bash_exec, in_docker
+from conftest import assert_bash_exec, in_container
-@pytest.mark.bashcomp(ignore_env=r"^[+-]MANPATH=")
+@pytest.mark.bashcomp(
+ ignore_env=r"^[+-]((BASHOPTS|MANPATH)=|shopt -. failglob)"
+)
class TestMan:
manpath = "$PWD/man"
@@ -29,7 +31,9 @@ class TestMan:
)
@pytest.mark.complete(
- "man bash-completion-testcas", env=dict(MANPATH=manpath)
+ "man bash-completion-testcas",
+ env=dict(MANPATH=manpath),
+ require_cmd=True,
)
def test_1(self, completion):
assert completion == "bash-completion-testcase"
@@ -43,7 +47,7 @@ class TestMan:
assert completion == "man/quux.8"
@pytest.mark.xfail(
- in_docker() and os.environ.get("DIST") == "centos6",
+ in_container() and os.environ.get("DIST") == "centos6",
reason="TODO: Fails in CentOS for some reason, unknown "
"how to trigger same behavior as tests show (is "
"different and correct when tried manually, but here "
@@ -64,6 +68,7 @@ class TestMan:
@pytest.mark.complete(
"man %s" % assumed_present,
+ require_cmd=True,
cwd="shared/empty_dir",
env=dict(MANPATH="%s:" % manpath),
)
@@ -72,13 +77,16 @@ class TestMan:
assert completion
@pytest.mark.complete(
- "man bash-completion-testcas", env=dict(MANPATH="%s:" % manpath)
+ "man bash-completion-testcas",
+ require_cmd=True,
+ env=dict(MANPATH="%s:" % manpath),
)
def test_6(self, completion):
assert completion == "bash-completion-testcase"
@pytest.mark.complete(
"man %s" % assumed_present,
+ require_cmd=True,
cwd="shared/empty_dir",
env=dict(MANPATH=":%s" % manpath),
)
@@ -87,13 +95,16 @@ class TestMan:
assert completion
@pytest.mark.complete(
- "man bash-completion-testcas", env=dict(MANPATH=":%s" % manpath)
+ "man bash-completion-testcas",
+ require_cmd=True,
+ env=dict(MANPATH=":%s" % manpath),
)
def test_8(self, completion):
assert completion == "bash-completion-testcase"
@pytest.mark.complete(
"man %s" % assumed_present,
+ require_cmd=True,
cwd="shared/empty_dir",
pre_cmds=("shopt -s failglob",),
)
@@ -102,7 +113,13 @@ class TestMan:
assert_bash_exec(bash, "shopt -u failglob")
@pytest.mark.complete(
- "man Bash::C", env=dict(MANPATH="%s:../tmp/man" % manpath)
+ "man Bash::C",
+ require_cmd=True,
+ env=dict(MANPATH="%s:../tmp/man" % manpath),
)
def test_10(self, bash, colonpath, completion):
assert completion == "Bash::Completion"
+
+ @pytest.mark.complete("man -", require_cmd=True)
+ def test_11(self, completion):
+ assert completion
diff --git a/test/t/test_mc.py b/test/t/test_mc.py
index 9632d6a9..31f88b78 100644
--- a/test/t/test_mc.py
+++ b/test/t/test_mc.py
@@ -2,6 +2,6 @@ import pytest
class TestMc:
- @pytest.mark.complete("mc -")
+ @pytest.mark.complete("mc -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_mcrypt.py b/test/t/test_mcrypt.py
index da80ef5d..d11f4467 100644
--- a/test/t/test_mcrypt.py
+++ b/test/t/test_mcrypt.py
@@ -6,10 +6,14 @@ class TestMcrypt:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("mcrypt -a ")
+ @pytest.mark.complete("mcrypt -a ", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("mcrypt -m ")
+ @pytest.mark.complete("mcrypt -m ", require_cmd=True)
def test_3(self, completion):
assert completion
+
+ @pytest.mark.complete("mcrypt -", require_cmd=True)
+ def test_4(self, completion):
+ assert completion
diff --git a/test/t/test_md5sum.py b/test/t/test_md5sum.py
index fa364ea1..0a3286ad 100644
--- a/test/t/test_md5sum.py
+++ b/test/t/test_md5sum.py
@@ -5,3 +5,7 @@ class TestMd5sum:
@pytest.mark.complete("md5sum ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("md5sum -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_medusa.py b/test/t/test_medusa.py
index bffa1c46..87fb91b7 100644
--- a/test/t/test_medusa.py
+++ b/test/t/test_medusa.py
@@ -2,6 +2,6 @@ import pytest
class TestMedusa:
- @pytest.mark.complete("medusa -")
+ @pytest.mark.complete("medusa -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_mencoder.py b/test/t/test_mencoder.py
index ba946c7e..a17fb960 100644
--- a/test/t/test_mencoder.py
+++ b/test/t/test_mencoder.py
@@ -7,6 +7,6 @@ class TestMencoder:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("mencoder -v")
+ @pytest.mark.complete("mencoder -v", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_mii_diag.py b/test/t/test_mii_diag.py
index fa527e94..6ed96aa9 100644
--- a/test/t/test_mii_diag.py
+++ b/test/t/test_mii_diag.py
@@ -6,3 +6,7 @@ class TestMiiDiag:
@pytest.mark.complete("mii-diag ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("mii-diag -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_mii_tool.py b/test/t/test_mii_tool.py
index 32568f82..f028787e 100644
--- a/test/t/test_mii_tool.py
+++ b/test/t/test_mii_tool.py
@@ -6,3 +6,7 @@ class TestMiiTool:
@pytest.mark.complete("mii-tool ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("mii-tool -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_minicom.py b/test/t/test_minicom.py
index c004fadd..6fac4570 100644
--- a/test/t/test_minicom.py
+++ b/test/t/test_minicom.py
@@ -2,6 +2,6 @@ import pytest
class TestMinicom:
- @pytest.mark.complete("minicom -")
+ @pytest.mark.complete("minicom -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_mkdir.py b/test/t/test_mkdir.py
index a5eb1a54..1b9cb9dc 100644
--- a/test/t/test_mkdir.py
+++ b/test/t/test_mkdir.py
@@ -16,3 +16,7 @@ class TestMkdir:
def test_3(self, completion):
assert completion.output == "foo"
assert completion == [completion.output]
+
+ @pytest.mark.complete("mkdir -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_mkfifo.py b/test/t/test_mkfifo.py
index b9e0013c..92e82de7 100644
--- a/test/t/test_mkfifo.py
+++ b/test/t/test_mkfifo.py
@@ -5,3 +5,7 @@ class TestMkfifo:
@pytest.mark.complete("mkfifo ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("mkfifo -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_mknod.py b/test/t/test_mknod.py
index 46cb2284..03f21e8c 100644
--- a/test/t/test_mknod.py
+++ b/test/t/test_mknod.py
@@ -5,3 +5,7 @@ class TestMknod:
@pytest.mark.complete("mknod ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("mknod -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_mock.py b/test/t/test_mock.py
index 7dc5de2a..5f9eb3e0 100644
--- a/test/t/test_mock.py
+++ b/test/t/test_mock.py
@@ -5,3 +5,9 @@ class TestMock:
@pytest.mark.complete("mock ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete(
+ "mock -", require_cmd=True, xfail="! mock --help &>/dev/null"
+ )
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_modinfo.py b/test/t/test_modinfo.py
index 4c96eef0..a4f5c50a 100644
--- a/test/t/test_modinfo.py
+++ b/test/t/test_modinfo.py
@@ -4,14 +4,14 @@ import pytest
class TestModinfo:
- @pytest.mark.complete("modinfo -")
+ @pytest.mark.complete("modinfo -", require_cmd=True)
def test_1(self, completion):
assert completion
# "in": intel*, ...
@pytest.mark.complete(
"modinfo in",
- skipif="! ls /lib/modules/%s &>/dev/null"
+ xfail="! ls /lib/modules/%s &>/dev/null"
% subprocess.check_output(
"uname -r 2>/dev/null || " "echo non-existent-kernel", shell=True
)
diff --git a/test/t/test_modprobe.py b/test/t/test_modprobe.py
index 339240f6..38d290ae 100644
--- a/test/t/test_modprobe.py
+++ b/test/t/test_modprobe.py
@@ -11,7 +11,7 @@ class TestModprobe:
# "in": intel*, ...
@pytest.mark.complete(
"modprobe in",
- skipif="! ls /lib/modules/%s &>/dev/null"
+ xfail="! ls /lib/modules/%s &>/dev/null"
% subprocess.check_output(
"uname -r 2>/dev/null || " "echo non-existent-kernel", shell=True
)
diff --git a/test/t/test_monodevelop.py b/test/t/test_monodevelop.py
index 472b1aba..59435a16 100644
--- a/test/t/test_monodevelop.py
+++ b/test/t/test_monodevelop.py
@@ -5,3 +5,7 @@ class TestMonodevelop:
@pytest.mark.complete("monodevelop ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("monodevelop -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_mplayer.py b/test/t/test_mplayer.py
index 88d7b9f1..a06991b2 100644
--- a/test/t/test_mplayer.py
+++ b/test/t/test_mplayer.py
@@ -7,6 +7,6 @@ class TestMplayer:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("mplayer -h")
+ @pytest.mark.complete("mplayer -h", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_mr.py b/test/t/test_mr.py
index ab45350b..768e1b35 100644
--- a/test/t/test_mr.py
+++ b/test/t/test_mr.py
@@ -9,35 +9,47 @@ class TestMr:
# man -h tests below: Some mr versions require man to be around in order
# to provide useful output.
- @pytest.mark.complete("mr --", skipif="! man -h &>/dev/null")
+ @pytest.mark.complete(
+ "mr --", require_cmd=True, xfail="! man -h &>/dev/null"
+ )
def test_2(self, completion):
assert completion
@pytest.mark.complete(
- "mr -c shared/default/foo.d/", skipif="! man -h &>/dev/null"
+ "mr -c shared/default/foo.d/", xfail="! man -h &>/dev/null"
)
def test_3(self, completion):
assert completion == "shared/default/foo.d/foo"
@pytest.mark.complete(
- "mr bootstrap shared/default/", skipif="! man -h &>/dev/null"
+ "mr bootstrap shared/default/",
+ require_cmd=True,
+ xfail="! man -h &>/dev/null",
)
def test_4(self, completion):
assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"]
@pytest.mark.xfail # "clean" doesn't exist before mr 1.20141023
- @pytest.mark.complete("mr clean -", skipif="! man -h &>/dev/null")
+ @pytest.mark.complete(
+ "mr clean -", require_cmd=True, xfail="! man -h &>/dev/null"
+ )
def test_5(self, completion):
assert completion == "-f"
- @pytest.mark.complete("mr commit -", skipif="! man -h &>/dev/null")
+ @pytest.mark.complete(
+ "mr commit -", require_cmd=True, xfail="! man -h &>/dev/null"
+ )
def test_6(self, completion):
assert completion == "-m"
- @pytest.mark.complete("mr status ", skipif="! man -h &>/dev/null")
+ @pytest.mark.complete(
+ "mr status ", require_cmd=True, xfail="! man -h &>/dev/null"
+ )
def test_7(self, completion):
assert not completion
- @pytest.mark.complete("mr run ", skipif="! man -h &>/dev/null")
+ @pytest.mark.complete(
+ "mr run ", require_cmd=True, xfail="! man -h &>/dev/null"
+ )
def test_8(self, completion):
assert completion
diff --git a/test/t/test_msgsnarf.py b/test/t/test_msgsnarf.py
index 5ef0fcb7..74844565 100644
--- a/test/t/test_msgsnarf.py
+++ b/test/t/test_msgsnarf.py
@@ -2,6 +2,6 @@ import pytest
class TestMsgsnarf:
- @pytest.mark.complete("msgsnarf -")
+ @pytest.mark.complete("msgsnarf -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_munin_node_configure.py b/test/t/test_munin_node_configure.py
index f3f23e7d..e7570d84 100644
--- a/test/t/test_munin_node_configure.py
+++ b/test/t/test_munin_node_configure.py
@@ -6,3 +6,14 @@ class TestMuninNodeConfigure:
@pytest.mark.complete("munin-node-configure --libdir ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete(
+ "munin-node-configure -",
+ require_cmd=True,
+ xfail=(
+ "! (munin-node-configure --help 2>&1 || :) "
+ "| command grep -q -- '[[:space:]]-'"
+ ),
+ )
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_munin_run.py b/test/t/test_munin_run.py
index 1bcb4d85..a0314495 100644
--- a/test/t/test_munin_run.py
+++ b/test/t/test_munin_run.py
@@ -3,6 +3,6 @@ import pytest
@pytest.mark.bashcomp(cmd="munin-run")
class TestMuninRun:
- @pytest.mark.complete("munin-run -")
+ @pytest.mark.complete("munin-run -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_munindoc.py b/test/t/test_munindoc.py
index 6b226e43..eea13caa 100644
--- a/test/t/test_munindoc.py
+++ b/test/t/test_munindoc.py
@@ -4,6 +4,7 @@ import pytest
class TestMunindoc:
# Assume at least munin* available
- @pytest.mark.complete("munindoc m")
+ # require_cmd is not strictly correct here, but...
+ @pytest.mark.complete("munindoc m", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_mussh.py b/test/t/test_mussh.py
index 87dd52a1..357c2b5b 100644
--- a/test/t/test_mussh.py
+++ b/test/t/test_mussh.py
@@ -2,6 +2,6 @@ import pytest
class TestMussh:
- @pytest.mark.complete("mussh -")
+ @pytest.mark.complete("mussh -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_mutt.py b/test/t/test_mutt.py
index b490c88b..0c4074f8 100644
--- a/test/t/test_mutt.py
+++ b/test/t/test_mutt.py
@@ -9,7 +9,7 @@ class TestMutt:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("mutt -F muttrc -f =", cwd="mutt")
+ @pytest.mark.complete("mutt -F muttrc -f =", require_cmd=True, cwd="mutt")
def test_2(self, completion):
assert completion == "bar/ foo/ muttrc".split()
diff --git a/test/t/test_mv.py b/test/t/test_mv.py
index a9fc969d..4a354db2 100644
--- a/test/t/test_mv.py
+++ b/test/t/test_mv.py
@@ -5,3 +5,7 @@ class TestMv:
@pytest.mark.complete("mv ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("mv -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_mypy.py b/test/t/test_mypy.py
index cecea92d..63fc916c 100644
--- a/test/t/test_mypy.py
+++ b/test/t/test_mypy.py
@@ -6,7 +6,7 @@ class TestMypy:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("mypy --")
+ @pytest.mark.complete("mypy --", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_mysqladmin.py b/test/t/test_mysqladmin.py
index 74db63b0..85046fe5 100644
--- a/test/t/test_mysqladmin.py
+++ b/test/t/test_mysqladmin.py
@@ -2,6 +2,6 @@ import pytest
class TestMysqladmin:
- @pytest.mark.complete("mysqladmin -")
+ @pytest.mark.complete("mysqladmin -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_nc.py b/test/t/test_nc.py
index 6a50106e..38db5acd 100644
--- a/test/t/test_nc.py
+++ b/test/t/test_nc.py
@@ -2,6 +2,6 @@ import pytest
class TestNc:
- @pytest.mark.complete("nc -")
+ @pytest.mark.complete("nc -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ncftp.py b/test/t/test_ncftp.py
index 470f6a76..b37f48f8 100644
--- a/test/t/test_ncftp.py
+++ b/test/t/test_ncftp.py
@@ -6,6 +6,6 @@ class TestNcftp:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("ncftp -")
+ @pytest.mark.complete("ncftp -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_nethogs.py b/test/t/test_nethogs.py
index a36c587f..c57185fa 100644
--- a/test/t/test_nethogs.py
+++ b/test/t/test_nethogs.py
@@ -5,3 +5,7 @@ class TestNethogs:
@pytest.mark.complete("nethogs ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("nethogs -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_netstat.py b/test/t/test_netstat.py
index 6bcbd4d2..57ef26c0 100644
--- a/test/t/test_netstat.py
+++ b/test/t/test_netstat.py
@@ -5,3 +5,7 @@ class TestNetstat:
@pytest.mark.complete("netstat ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("netstat -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_newlist.py b/test/t/test_newlist.py
index d51dab26..1d6b439a 100644
--- a/test/t/test_newlist.py
+++ b/test/t/test_newlist.py
@@ -2,6 +2,6 @@ import pytest
class TestNewlist:
- @pytest.mark.complete("newlist -")
+ @pytest.mark.complete("newlist -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_newusers.py b/test/t/test_newusers.py
index acd93ad2..51d746a0 100644
--- a/test/t/test_newusers.py
+++ b/test/t/test_newusers.py
@@ -5,3 +5,7 @@ class TestNewusers:
@pytest.mark.complete("newusers ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("newusers -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_ngrep.py b/test/t/test_ngrep.py
index 0d29abd7..53fa60d0 100644
--- a/test/t/test_ngrep.py
+++ b/test/t/test_ngrep.py
@@ -2,7 +2,7 @@ import pytest
class TestNgrep:
- @pytest.mark.complete("ngrep -")
+ @pytest.mark.complete("ngrep -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_nl.py b/test/t/test_nl.py
index c3e35b42..ca910a59 100644
--- a/test/t/test_nl.py
+++ b/test/t/test_nl.py
@@ -5,3 +5,7 @@ class TestNl:
@pytest.mark.complete("nl ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("nl -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_nm.py b/test/t/test_nm.py
index 49ff167e..328fa507 100644
--- a/test/t/test_nm.py
+++ b/test/t/test_nm.py
@@ -5,3 +5,7 @@ class TestNm:
@pytest.mark.complete("nm ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("nm -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_nproc.py b/test/t/test_nproc.py
index 6ab8017c..66a49acb 100644
--- a/test/t/test_nproc.py
+++ b/test/t/test_nproc.py
@@ -6,6 +6,12 @@ class TestNproc:
def test_1(self, completion):
assert not completion
- @pytest.mark.complete("nproc -")
+ @pytest.mark.complete(
+ "nproc --",
+ xfail=(
+ "! nproc --help &>/dev/null || "
+ "! nproc --help 2>&1 | command grep -qF -- --help"
+ ),
+ )
def test_2(self, completion):
assert completion
diff --git a/test/t/test_nsupdate.py b/test/t/test_nsupdate.py
index 5bae9707..b8a133cb 100644
--- a/test/t/test_nsupdate.py
+++ b/test/t/test_nsupdate.py
@@ -6,6 +6,6 @@ class TestNsupdate:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("nsupdate -")
+ @pytest.mark.complete("nsupdate -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_ntpdate.py b/test/t/test_ntpdate.py
index dc1d5b48..c8d65cfd 100644
--- a/test/t/test_ntpdate.py
+++ b/test/t/test_ntpdate.py
@@ -2,6 +2,6 @@ import pytest
class TestNtpdate:
- @pytest.mark.complete("ntpdate -")
+ @pytest.mark.complete("ntpdate -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_objcopy.py b/test/t/test_objcopy.py
index 13a93df5..e3130fab 100644
--- a/test/t/test_objcopy.py
+++ b/test/t/test_objcopy.py
@@ -5,3 +5,7 @@ class TestObjcopy:
@pytest.mark.complete("objcopy ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("objcopy -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_od.py b/test/t/test_od.py
index a1e648a8..e2f5de28 100644
--- a/test/t/test_od.py
+++ b/test/t/test_od.py
@@ -5,3 +5,7 @@ class TestOd:
@pytest.mark.complete("od ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("od -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_oggdec.py b/test/t/test_oggdec.py
index 8cabe5cd..395bb866 100644
--- a/test/t/test_oggdec.py
+++ b/test/t/test_oggdec.py
@@ -6,6 +6,6 @@ class TestOggdec:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("oggdec --")
+ @pytest.mark.complete("oggdec --", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_op.py b/test/t/test_op.py
index e09c98c8..662cde5f 100644
--- a/test/t/test_op.py
+++ b/test/t/test_op.py
@@ -2,10 +2,10 @@ import pytest
class TestOp:
- @pytest.mark.complete("op ")
+ @pytest.mark.complete("op ", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("op --")
+ @pytest.mark.complete("op --", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_opera.py b/test/t/test_opera.py
index 5ab056f4..f0c657e7 100644
--- a/test/t/test_opera.py
+++ b/test/t/test_opera.py
@@ -5,3 +5,7 @@ class TestOpera:
@pytest.mark.complete("opera ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("opera -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_optipng.py b/test/t/test_optipng.py
index 393b0645..615d71fb 100644
--- a/test/t/test_optipng.py
+++ b/test/t/test_optipng.py
@@ -5,3 +5,7 @@ class TestOptipng:
@pytest.mark.complete("optipng ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("optipng -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_passwd.py b/test/t/test_passwd.py
index 60441de9..f253701b 100644
--- a/test/t/test_passwd.py
+++ b/test/t/test_passwd.py
@@ -6,6 +6,6 @@ class TestPasswd:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("passwd -")
+ @pytest.mark.complete("passwd -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_paste.py b/test/t/test_paste.py
index 2d551322..ecf030b5 100644
--- a/test/t/test_paste.py
+++ b/test/t/test_paste.py
@@ -5,3 +5,7 @@ class TestPaste:
@pytest.mark.complete("paste ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("paste -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_patch.py b/test/t/test_patch.py
index 455ebd9a..c68a4b65 100644
--- a/test/t/test_patch.py
+++ b/test/t/test_patch.py
@@ -5,3 +5,7 @@ class TestPatch:
@pytest.mark.complete("patch ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("patch -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_pdftotext.py b/test/t/test_pdftotext.py
index 9e332f06..90d001f6 100644
--- a/test/t/test_pdftotext.py
+++ b/test/t/test_pdftotext.py
@@ -5,3 +5,7 @@ class TestPdftotext:
@pytest.mark.complete("pdftotext ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("pdftotext -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_perl.py b/test/t/test_perl.py
index 7c0c6094..c8baa2f3 100644
--- a/test/t/test_perl.py
+++ b/test/t/test_perl.py
@@ -11,33 +11,33 @@ class TestPerl:
def test_2(self, completion):
assert not completion
- @pytest.mark.complete("perl -V:install")
+ @pytest.mark.complete("perl -V:install", require_cmd=True)
def test_3(self, completion):
assert completion
- @pytest.mark.complete("perl -V::install")
+ @pytest.mark.complete("perl -V::install", require_cmd=True)
def test_4(self, completion):
assert completion
# Assume File::Spec and friends are always installed
- @pytest.mark.complete("perl -MFile")
+ @pytest.mark.complete("perl -MFile", require_cmd=True)
def test_5(self, completion):
assert completion
- @pytest.mark.complete("perl -MFile::Sp")
+ @pytest.mark.complete("perl -MFile::Sp", require_cmd=True)
def test_6(self, completion):
assert completion
- @pytest.mark.complete("perl -MFile::Spec::Func")
+ @pytest.mark.complete("perl -MFile::Spec::Func", require_cmd=True)
def test_7(self, completion):
assert completion
- @pytest.mark.complete("perl -M-File")
+ @pytest.mark.complete("perl -M-File", require_cmd=True)
def test_8(self, completion):
assert completion
- @pytest.mark.complete("perl -m-File::")
+ @pytest.mark.complete("perl -m-File::", require_cmd=True)
def test_9(self, completion):
assert completion
@@ -67,13 +67,25 @@ class TestPerl:
@pytest.mark.complete("perl -x shared/default/b")
def test_15(self, completion):
- """-x with space should complete dirs."""
- assert completion == ["shared/default/bar bar.d/"]
+ """-x with space should complete files+dirs."""
+ assert completion == ["bar", "bar bar.d/"]
- @pytest.mark.complete("perl -d:", env=dict(PERL5LIB="$PWD/perl"))
+ @pytest.mark.complete(
+ "perl -d:", env=dict(PERL5LIB="$PWD/perl"), require_cmd=True
+ )
def test_16(self, completion):
assert "BashCompletion" in completion
- @pytest.mark.complete("perl -dt:", env=dict(PERL5LIB="$PWD/perl"))
+ @pytest.mark.complete(
+ "perl -dt:", env=dict(PERL5LIB="$PWD/perl"), require_cmd=True
+ )
def test_17(self, completion):
assert "BashCompletion" in completion
+
+ @pytest.mark.complete("perl -E ")
+ def test_dash_capital_e(self, completion):
+ assert not completion
+
+ @pytest.mark.complete("perl -e")
+ def test_dash_e(self, completion):
+ assert not completion
diff --git a/test/t/test_perlcritic.py b/test/t/test_perlcritic.py
index cc4ef25f..51ba2012 100644
--- a/test/t/test_perlcritic.py
+++ b/test/t/test_perlcritic.py
@@ -6,10 +6,10 @@ class TestPerlcritic:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("perlcritic --")
+ @pytest.mark.complete("perlcritic --", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("perlcritic --theme ")
+ @pytest.mark.complete("perlcritic --theme ", require_cmd=True)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_perldoc.py b/test/t/test_perldoc.py
index 9f772944..282f824b 100644
--- a/test/t/test_perldoc.py
+++ b/test/t/test_perldoc.py
@@ -9,7 +9,7 @@ class TestPerldoc:
assert "fixtures/" not in completion # Our fixtures/ dir
assert not [x for x in completion if "File::File::" in x]
- @pytest.mark.complete("perldoc -")
+ @pytest.mark.complete("perldoc -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_perltidy.py b/test/t/test_perltidy.py
index 3bafd6e4..578923af 100644
--- a/test/t/test_perltidy.py
+++ b/test/t/test_perltidy.py
@@ -6,14 +6,14 @@ class TestPerltidy:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("perltidy -h")
+ @pytest.mark.complete("perltidy -h", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("perltidy -ole=")
+ @pytest.mark.complete("perltidy -ole=", require_cmd=True)
def test_3(self, completion):
assert completion
- @pytest.mark.complete("perltidy -doesntexist=")
+ @pytest.mark.complete("perltidy -doesntexist=", require_cmd=True)
def test_4(self, completion):
assert not completion
diff --git a/test/t/test_pgrep.py b/test/t/test_pgrep.py
index 1155e582..9c233311 100644
--- a/test/t/test_pgrep.py
+++ b/test/t/test_pgrep.py
@@ -7,3 +7,7 @@ class TestPgrep:
@pytest.mark.complete("pgrep p")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("pgrep -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_phing.py b/test/t/test_phing.py
index 2e8c1069..973a957d 100644
--- a/test/t/test_phing.py
+++ b/test/t/test_phing.py
@@ -2,10 +2,10 @@ import pytest
class TestPhing:
- @pytest.mark.complete("phing -")
+ @pytest.mark.complete("phing -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("phing -l ")
+ @pytest.mark.complete("phing -l ", require_cmd=True)
def test_2(self, completion):
assert not completion
diff --git a/test/t/test_pidof.py b/test/t/test_pidof.py
index fb553e55..c33a4d39 100644
--- a/test/t/test_pidof.py
+++ b/test/t/test_pidof.py
@@ -7,3 +7,9 @@ class TestPidof:
@pytest.mark.complete("pidof p")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete(
+ "pidof -", require_cmd=True, xfail="! pidof --help &>/dev/null"
+ )
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_pine.py b/test/t/test_pine.py
index 2c5549e0..0c95973f 100644
--- a/test/t/test_pine.py
+++ b/test/t/test_pine.py
@@ -2,6 +2,6 @@ import pytest
class TestPine:
- @pytest.mark.complete("pine -")
+ @pytest.mark.complete("pine -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pinfo.py b/test/t/test_pinfo.py
index b502273f..a22128e3 100644
--- a/test/t/test_pinfo.py
+++ b/test/t/test_pinfo.py
@@ -3,7 +3,7 @@ import pytest
@pytest.mark.bashcomp(pre_cmds=("INFOPATH+=:$PWD/info:",))
class TestPinfo:
- @pytest.mark.complete("pinfo -")
+ @pytest.mark.complete("pinfo -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ping.py b/test/t/test_ping.py
index e7c77365..f70582a0 100644
--- a/test/t/test_ping.py
+++ b/test/t/test_ping.py
@@ -6,6 +6,6 @@ class TestPing:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("ping -")
+ @pytest.mark.complete("ping -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_pkg_config.py b/test/t/test_pkg_config.py
index a0703e09..81e02cad 100644
--- a/test/t/test_pkg_config.py
+++ b/test/t/test_pkg_config.py
@@ -7,6 +7,6 @@ class TestPkgConfig:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("pkg-config -")
+ @pytest.mark.complete("pkg-config -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_pkgadd.py b/test/t/test_pkgadd.py
index ca6baf27..69d08dcd 100644
--- a/test/t/test_pkgadd.py
+++ b/test/t/test_pkgadd.py
@@ -2,6 +2,7 @@ import pytest
class TestPkgadd:
- @pytest.mark.complete("pkgadd ")
+ # require_cmd is not strictly true here, but...
+ @pytest.mark.complete("pkgadd ", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pkgrm.py b/test/t/test_pkgrm.py
index 9cb73571..2af81ef9 100644
--- a/test/t/test_pkgrm.py
+++ b/test/t/test_pkgrm.py
@@ -2,6 +2,7 @@ import pytest
class TestPkgrm:
- @pytest.mark.complete("pkgrm ")
+ # require_cmd is not strictly true here, but...
+ @pytest.mark.complete("pkgrm ", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pkill.py b/test/t/test_pkill.py
index b0af6c3d..a779958b 100644
--- a/test/t/test_pkill.py
+++ b/test/t/test_pkill.py
@@ -5,3 +5,7 @@ class TestPkill:
@pytest.mark.complete("pkill ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("pkill -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_pngfix.py b/test/t/test_pngfix.py
index e27f3293..9b35a398 100644
--- a/test/t/test_pngfix.py
+++ b/test/t/test_pngfix.py
@@ -6,6 +6,6 @@ class TestPngfix:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("pngfix -")
+ @pytest.mark.complete("pngfix -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_portinstall.py b/test/t/test_portinstall.py
index 62fddbfb..eb2118e5 100644
--- a/test/t/test_portinstall.py
+++ b/test/t/test_portinstall.py
@@ -3,10 +3,11 @@ import pytest
from conftest import assert_bash_exec
+@pytest.mark.bashcomp(ignore_env=r"^[+-]PORTSDIR=")
class TestPortinstall:
@pytest.fixture(scope="class")
def portsdir(self, request, bash):
- assert_bash_exec(bash, "PORTSDIR=$TESTDIR/tmp")
+ assert_bash_exec(bash, "PORTSDIR=$PWD/../tmp")
assert_bash_exec(
bash,
"command sed -e s,PORTSDIR,$PORTSDIR,g "
@@ -17,7 +18,7 @@ class TestPortinstall:
lambda: assert_bash_exec(bash, "rm $PORTSDIR/INDEX{,-5}")
)
- @pytest.mark.complete("portinstall ", env=dict(PORTSDIR="$TESTDIR/tmp"))
+ @pytest.mark.complete("portinstall ", env=dict(PORTSDIR="$PWD/../tmp"))
def test_1(self, completion, portsdir):
assert (
completion
diff --git a/test/t/test_portupgrade.py b/test/t/test_portupgrade.py
index aaff5c10..0b46bbf4 100644
--- a/test/t/test_portupgrade.py
+++ b/test/t/test_portupgrade.py
@@ -1,9 +1,8 @@
import pytest
-@pytest.mark.bashcomp(pre_cmds=("PKG_DBDIR=$PWD/dbtools/db",))
+@pytest.mark.bashcomp(pre_cmds=("PKG_DBDIR=$PWD/pkgtools/db",))
class TestPortupgrade:
@pytest.mark.complete("portupgrade ")
def test_1(self, completion):
assert completion == "a b-c-d".split()
- assert completion.endswith(" ")
diff --git a/test/t/test_postcat.py b/test/t/test_postcat.py
index 653cca25..73922e27 100644
--- a/test/t/test_postcat.py
+++ b/test/t/test_postcat.py
@@ -5,3 +5,7 @@ class TestPostcat:
@pytest.mark.complete("postcat ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("postcat -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_postconf.py b/test/t/test_postconf.py
index 641b2734..e0349566 100644
--- a/test/t/test_postconf.py
+++ b/test/t/test_postconf.py
@@ -2,7 +2,7 @@ import pytest
class TestPostconf:
- @pytest.mark.complete("postconf -")
+ @pytest.mark.complete("postconf -", require_cmd=True)
def test_1(self, completion):
assert len(completion) > 1
@@ -13,6 +13,8 @@ class TestPostconf:
# for ::1
# ...and output can be cut off somewhere near lmtp_tls_secur*.
# ...or be completely missing, so all we can do is to skip.
- @pytest.mark.complete("postconf al", skipif="! postconf &>/dev/null")
+ @pytest.mark.complete(
+ "postconf al", require_cmd=True, xfail="! postconf &>/dev/null"
+ )
def test_2(self, completion):
assert completion
diff --git a/test/t/test_postfix.py b/test/t/test_postfix.py
index f7af7b4c..67a898d1 100644
--- a/test/t/test_postfix.py
+++ b/test/t/test_postfix.py
@@ -5,3 +5,8 @@ class TestPostfix:
@pytest.mark.complete("postfix ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.xfail # see TODO in completion
+ @pytest.mark.complete("postfix -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_postmap.py b/test/t/test_postmap.py
index f3430fbd..ee3eee7a 100644
--- a/test/t/test_postmap.py
+++ b/test/t/test_postmap.py
@@ -5,3 +5,7 @@ class TestPostmap:
@pytest.mark.complete("postmap ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("postmap -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_pr.py b/test/t/test_pr.py
index cb023ea0..c790a866 100644
--- a/test/t/test_pr.py
+++ b/test/t/test_pr.py
@@ -5,3 +5,7 @@ class TestPr:
@pytest.mark.complete("pr ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("pr -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_prelink.py b/test/t/test_prelink.py
index ef8baece..e75b9699 100644
--- a/test/t/test_prelink.py
+++ b/test/t/test_prelink.py
@@ -6,6 +6,6 @@ class TestPrelink:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("prelink -")
+ @pytest.mark.complete("prelink -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_protoc.py b/test/t/test_protoc.py
index 65549d35..e890c56a 100644
--- a/test/t/test_protoc.py
+++ b/test/t/test_protoc.py
@@ -5,3 +5,7 @@ class TestProtoc:
@pytest.mark.complete("protoc ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("protoc -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_psql.py b/test/t/test_psql.py
index 60ed097c..ffd6c058 100644
--- a/test/t/test_psql.py
+++ b/test/t/test_psql.py
@@ -4,6 +4,8 @@ import pytest
class TestPsql:
# --help can fail due to missing package dependencies, e.g. on Ubuntu 14
- @pytest.mark.complete("psql -", skipif="! psql --help &>/dev/null")
+ @pytest.mark.complete(
+ "psql -", require_cmd=True, xfail="! psql --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ptx.py b/test/t/test_ptx.py
index 2eea63bc..9ddc91c9 100644
--- a/test/t/test_ptx.py
+++ b/test/t/test_ptx.py
@@ -5,3 +5,7 @@ class TestPtx:
@pytest.mark.complete("ptx ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("ptx -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_pv.py b/test/t/test_pv.py
index ffca68df..ad04c47b 100644
--- a/test/t/test_pv.py
+++ b/test/t/test_pv.py
@@ -6,7 +6,7 @@ class TestPv:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("pv -")
+ @pytest.mark.complete("pv -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_pvchange.py b/test/t/test_pvchange.py
index 78e534ac..4b0a94cb 100644
--- a/test/t/test_pvchange.py
+++ b/test/t/test_pvchange.py
@@ -3,7 +3,7 @@ import pytest
class TestPvchange:
@pytest.mark.complete(
- "pvchange --", skipif="! pvchange --help &>/dev/null"
+ "pvchange --", require_cmd=True, xfail="! pvchange --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pvcreate.py b/test/t/test_pvcreate.py
index 372b9e39..2847c47e 100644
--- a/test/t/test_pvcreate.py
+++ b/test/t/test_pvcreate.py
@@ -3,7 +3,7 @@ import pytest
class TestPvcreate:
@pytest.mark.complete(
- "pvcreate --", skipif="! pvcreate --help &>/dev/null"
+ "pvcreate --", require_cmd=True, xfail="! pvcreate --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pvdisplay.py b/test/t/test_pvdisplay.py
index e5fa07f6..9d1ea83c 100644
--- a/test/t/test_pvdisplay.py
+++ b/test/t/test_pvdisplay.py
@@ -3,7 +3,9 @@ import pytest
class TestPvdisplay:
@pytest.mark.complete(
- "pvdisplay --", skipif="! pvdisplay --help &>/dev/null"
+ "pvdisplay --",
+ require_cmd=True,
+ xfail="! pvdisplay --help &>/dev/null",
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pvmove.py b/test/t/test_pvmove.py
index e1b06dd6..e0e2ee89 100644
--- a/test/t/test_pvmove.py
+++ b/test/t/test_pvmove.py
@@ -2,6 +2,8 @@ import pytest
class TestPvmove:
- @pytest.mark.complete("pvmove --")
+ @pytest.mark.complete(
+ "pvmove --", require_cmd=True, xfail="! pvmove --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pvremove.py b/test/t/test_pvremove.py
index 08bf63b0..c9c031ab 100644
--- a/test/t/test_pvremove.py
+++ b/test/t/test_pvremove.py
@@ -3,7 +3,7 @@ import pytest
class TestPvremove:
@pytest.mark.complete(
- "pvremove --", skipif="! pvremove --help &>/dev/null"
+ "pvremove --", require_cmd=True, xfail="! pvremove --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pvs.py b/test/t/test_pvs.py
index 6063888e..ac173a72 100644
--- a/test/t/test_pvs.py
+++ b/test/t/test_pvs.py
@@ -2,6 +2,8 @@ import pytest
class TestPvs:
- @pytest.mark.complete("pvs --", skipif="! pvs --help &>/dev/null")
+ @pytest.mark.complete(
+ "pvs --", require_cmd=True, xfail="! pvs --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pvscan.py b/test/t/test_pvscan.py
index 1ae237fc..e2789565 100644
--- a/test/t/test_pvscan.py
+++ b/test/t/test_pvscan.py
@@ -2,6 +2,8 @@ import pytest
class TestPvscan:
- @pytest.mark.complete("pvscan --")
+ @pytest.mark.complete(
+ "pvscan --", require_cmd=True, xfail="! pvscan --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pwck.py b/test/t/test_pwck.py
index 143c76f1..1e36f87e 100644
--- a/test/t/test_pwck.py
+++ b/test/t/test_pwck.py
@@ -5,3 +5,7 @@ class TestPwck:
@pytest.mark.complete("pwck ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("pwck -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_pwd.py b/test/t/test_pwd.py
index b1ec3378..fe7dd08b 100644
--- a/test/t/test_pwd.py
+++ b/test/t/test_pwd.py
@@ -2,6 +2,6 @@ import pytest
class TestPwd:
- @pytest.mark.complete("pwd -")
+ @pytest.mark.complete("pwd -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pwdx.py b/test/t/test_pwdx.py
index 411d7a59..552c82c9 100644
--- a/test/t/test_pwdx.py
+++ b/test/t/test_pwdx.py
@@ -5,3 +5,15 @@ class TestPwdx:
@pytest.mark.complete("pwdx ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete(
+ "pwdx -",
+ require_cmd=True,
+ xfail=(
+ "! (pwdx --help 2>&1 || :) | "
+ "command grep -vF 'invalid process id: --help' | "
+ "command grep -q -- '[[:space:]]-'"
+ ),
+ )
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_pwgen.py b/test/t/test_pwgen.py
index 54c194cf..20ecd73b 100644
--- a/test/t/test_pwgen.py
+++ b/test/t/test_pwgen.py
@@ -2,6 +2,6 @@ import pytest
class TestPwgen:
- @pytest.mark.complete("pwgen -")
+ @pytest.mark.complete("pwgen -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pycodestyle.py b/test/t/test_pycodestyle.py
index 03c58eec..4b4f3a43 100644
--- a/test/t/test_pycodestyle.py
+++ b/test/t/test_pycodestyle.py
@@ -6,7 +6,7 @@ class TestPycodestyle:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("pycodestyle -")
+ @pytest.mark.complete("pycodestyle -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_pydoc.py b/test/t/test_pydoc.py
index e6173676..7cf7eb53 100644
--- a/test/t/test_pydoc.py
+++ b/test/t/test_pydoc.py
@@ -2,6 +2,10 @@ import pytest
class TestPydoc:
- @pytest.mark.complete("pydoc r")
+ @pytest.mark.complete("pydoc r", require_cmd=True)
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("pydoc -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_pydocstyle.py b/test/t/test_pydocstyle.py
index 4deb45fe..caa87902 100644
--- a/test/t/test_pydocstyle.py
+++ b/test/t/test_pydocstyle.py
@@ -6,6 +6,6 @@ class TestPydocstyle:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("pydocstyle -")
+ @pytest.mark.complete("pydocstyle -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_pyflakes.py b/test/t/test_pyflakes.py
index ae3853a7..96703217 100644
--- a/test/t/test_pyflakes.py
+++ b/test/t/test_pyflakes.py
@@ -5,3 +5,7 @@ class TestPyflakes:
@pytest.mark.complete("pyflakes ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("pyflakes -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_pylint.py b/test/t/test_pylint.py
index e08507aa..4b799532 100644
--- a/test/t/test_pylint.py
+++ b/test/t/test_pylint.py
@@ -2,7 +2,7 @@ import pytest
class TestPylint:
- @pytest.mark.complete("pylint --v")
+ @pytest.mark.complete("pylint --v", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_pylint_3.py b/test/t/test_pylint_3.py
index 305db7d3..ee498c32 100644
--- a/test/t/test_pylint_3.py
+++ b/test/t/test_pylint_3.py
@@ -3,7 +3,7 @@ import pytest
@pytest.mark.bashcomp(cmd="pylint-3")
class TestPylint3:
- @pytest.mark.complete("pylint-3 --v")
+ @pytest.mark.complete("pylint-3 --v", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_python.py b/test/t/test_python.py
index 4990f957..57802721 100644
--- a/test/t/test_python.py
+++ b/test/t/test_python.py
@@ -6,7 +6,7 @@ class TestPython:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("python -")
+ @pytest.mark.complete("python -", require_cmd=True)
def test_2(self, completion):
assert len(completion) > 1
@@ -30,6 +30,6 @@ class TestPython:
def test_7(self, completion):
assert not completion
- @pytest.mark.complete("python -m sy")
+ @pytest.mark.complete("python -m sy", require_cmd=True)
def test_8(self, completion):
assert completion
diff --git a/test/t/test_python3.py b/test/t/test_python3.py
index 3f2b5f9e..b968a34e 100644
--- a/test/t/test_python3.py
+++ b/test/t/test_python3.py
@@ -6,7 +6,7 @@ class TestPython3:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("python3 -")
+ @pytest.mark.complete("python3 -", require_cmd=True)
def test_2(self, completion):
assert len(completion) > 1
@@ -30,6 +30,6 @@ class TestPython3:
def test_7(self, completion):
assert not completion
- @pytest.mark.complete("python3 -m sy")
+ @pytest.mark.complete("python3 -m sy", require_cmd=True)
def test_8(self, completion):
assert completion
diff --git a/test/t/test_qemu.py b/test/t/test_qemu.py
index 3be6f64b..129c0b4f 100644
--- a/test/t/test_qemu.py
+++ b/test/t/test_qemu.py
@@ -5,3 +5,7 @@ class TestQemu:
@pytest.mark.complete("qemu ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("qemu -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_querybts.py b/test/t/test_querybts.py
index dd3af4f9..9c81d134 100644
--- a/test/t/test_querybts.py
+++ b/test/t/test_querybts.py
@@ -2,6 +2,6 @@ import pytest
class TestQuerybts:
- @pytest.mark.complete("querybts --")
+ @pytest.mark.complete("querybts --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_quota.py b/test/t/test_quota.py
index 75098875..c7445355 100644
--- a/test/t/test_quota.py
+++ b/test/t/test_quota.py
@@ -5,3 +5,7 @@ class TestQuota:
@pytest.mark.complete("quota ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("quota -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_quotacheck.py b/test/t/test_quotacheck.py
index 0311befb..81406040 100644
--- a/test/t/test_quotacheck.py
+++ b/test/t/test_quotacheck.py
@@ -2,6 +2,6 @@ import pytest
class TestQuotacheck:
- @pytest.mark.complete("quotacheck -")
+ @pytest.mark.complete("quotacheck -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_quotaon.py b/test/t/test_quotaon.py
index 46bf5546..c4386c6a 100644
--- a/test/t/test_quotaon.py
+++ b/test/t/test_quotaon.py
@@ -2,6 +2,6 @@ import pytest
class TestQuotaon:
- @pytest.mark.complete("quotaon -")
+ @pytest.mark.complete("quotaon -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_radvdump.py b/test/t/test_radvdump.py
index e3d9242d..a8a16d90 100644
--- a/test/t/test_radvdump.py
+++ b/test/t/test_radvdump.py
@@ -2,6 +2,10 @@ import pytest
class TestRadvdump:
- @pytest.mark.complete("radvdump ")
+ @pytest.mark.complete("radvdump ", require_cmd=True)
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("radvdump -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_rdesktop.py b/test/t/test_rdesktop.py
index b82b471e..f20ca518 100644
--- a/test/t/test_rdesktop.py
+++ b/test/t/test_rdesktop.py
@@ -2,6 +2,6 @@ import pytest
class TestRdesktop:
- @pytest.mark.complete("rdesktop -")
+ @pytest.mark.complete("rdesktop -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_rdict.py b/test/t/test_rdict.py
index 86d7c087..da6fb1bb 100644
--- a/test/t/test_rdict.py
+++ b/test/t/test_rdict.py
@@ -2,6 +2,6 @@ import pytest
class TestRdict:
- @pytest.mark.complete("rdict --")
+ @pytest.mark.complete("rdict --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_readelf.py b/test/t/test_readelf.py
index 5c5dff37..07ce347f 100644
--- a/test/t/test_readelf.py
+++ b/test/t/test_readelf.py
@@ -2,6 +2,6 @@ import pytest
class TestReadelf:
- @pytest.mark.complete("readelf --")
+ @pytest.mark.complete("readelf --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_repomanage.py b/test/t/test_repomanage.py
index 6def4a8c..bdaba156 100644
--- a/test/t/test_repomanage.py
+++ b/test/t/test_repomanage.py
@@ -5,3 +5,7 @@ class TestRepomanage:
@pytest.mark.complete("repomanage ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("repomanage -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_reportbug.py b/test/t/test_reportbug.py
index 612a96b8..2c57b56d 100644
--- a/test/t/test_reportbug.py
+++ b/test/t/test_reportbug.py
@@ -2,6 +2,6 @@ import pytest
class TestReportbug:
- @pytest.mark.complete("reportbug --m")
+ @pytest.mark.complete("reportbug --m", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_reptyr.py b/test/t/test_reptyr.py
index 62a9b1c5..7c27cb55 100644
--- a/test/t/test_reptyr.py
+++ b/test/t/test_reptyr.py
@@ -6,6 +6,6 @@ class TestReptyr:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("reptyr -")
+ @pytest.mark.complete("reptyr -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_ri.py b/test/t/test_ri.py
index e54f18bb..9430b667 100644
--- a/test/t/test_ri.py
+++ b/test/t/test_ri.py
@@ -3,7 +3,7 @@ import pytest
@pytest.mark.bashcomp(pre_cmds=("export RI='-d ri'",))
class TestRi:
- @pytest.mark.complete("ri -")
+ @pytest.mark.complete("ri -", require_cmd=True)
def test_1(self, completion):
assert completion
@@ -11,6 +11,6 @@ class TestRi:
def test_2(self, completion):
assert completion == "BashCompletion/ cache.ri".split()
- @pytest.mark.complete("ri BashCompletio")
+ @pytest.mark.complete("ri BashCompletio", require_cmd=True)
def test_3(self, completion):
assert completion == "BashCompletion"
diff --git a/test/t/test_rm.py b/test/t/test_rm.py
index 622ef13c..6fda5a1d 100644
--- a/test/t/test_rm.py
+++ b/test/t/test_rm.py
@@ -5,3 +5,7 @@ class TestRm:
@pytest.mark.complete("rm ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("rm -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_rmdir.py b/test/t/test_rmdir.py
index d416819a..b9816772 100644
--- a/test/t/test_rmdir.py
+++ b/test/t/test_rmdir.py
@@ -10,3 +10,7 @@ class TestRmdir:
def test_2(self, completion):
"""Should complete dirs only, also when invoked using full path."""
assert completion == ["bar bar.d/", "foo.d/"]
+
+ @pytest.mark.complete("rmdir -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_rmmod.py b/test/t/test_rmmod.py
index dfeb0090..55287059 100644
--- a/test/t/test_rmmod.py
+++ b/test/t/test_rmmod.py
@@ -2,6 +2,6 @@ import pytest
class TestRmmod:
- @pytest.mark.complete("rmmod -")
+ @pytest.mark.complete("rmmod -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_rpm.py b/test/t/test_rpm.py
index 939090dd..e6f71989 100644
--- a/test/t/test_rpm.py
+++ b/test/t/test_rpm.py
@@ -9,3 +9,7 @@ class TestRpm:
@pytest.mark.complete("rpm -q ", skipif='test -z "$(rpm -qa 2>/dev/null)"')
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("rpm -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_rpm2tgz.py b/test/t/test_rpm2tgz.py
index 366faedc..ad6e8bc7 100644
--- a/test/t/test_rpm2tgz.py
+++ b/test/t/test_rpm2tgz.py
@@ -12,9 +12,9 @@ class TestRpm2tgz:
def test_2(self, completion):
expected = sorted(
[
- "%s/"
+ "%s/" % x
for x in os.listdir("slackware/home")
- if os.path.isdir("shared/bin/%s" % x)
+ if os.path.isdir("slackware/home/%s" % x)
]
+ [
x
diff --git a/test/t/test_rpmbuild.py b/test/t/test_rpmbuild.py
index 13f164ba..06c8087d 100644
--- a/test/t/test_rpmbuild.py
+++ b/test/t/test_rpmbuild.py
@@ -2,6 +2,6 @@ import pytest
class TestRpmbuild:
- @pytest.mark.complete("rpmbuild -")
+ @pytest.mark.complete("rpmbuild -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_rtcwake.py b/test/t/test_rtcwake.py
index e9c12d07..19d1dfe3 100644
--- a/test/t/test_rtcwake.py
+++ b/test/t/test_rtcwake.py
@@ -2,6 +2,10 @@ import pytest
class TestRtcwake:
- @pytest.mark.complete("rtcwake ")
+ @pytest.mark.complete("rtcwake ", require_cmd=True)
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("rtcwake -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_sbcl_mt.py b/test/t/test_sbcl_mt.py
index 860acc2f..d8049f3f 100644
--- a/test/t/test_sbcl_mt.py
+++ b/test/t/test_sbcl_mt.py
@@ -3,6 +3,7 @@ import pytest
@pytest.mark.bashcomp(cmd="sbcl-mt")
class TestSbclMt:
+ @pytest.mark.xfail # TODO: whitespace split issue
@pytest.mark.complete("sbcl-mt shared/default/")
def test_1(self, completion):
assert completion == ["bar", "bar bar.d/", "foo", "foo foo.d/"]
diff --git a/test/t/test_sbopkg.py b/test/t/test_sbopkg.py
index cb1f7360..44f15219 100644
--- a/test/t/test_sbopkg.py
+++ b/test/t/test_sbopkg.py
@@ -2,6 +2,6 @@ import pytest
class TestSbopkg:
- @pytest.mark.complete("sbopkg -")
+ @pytest.mark.complete("sbopkg -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_screen.py b/test/t/test_screen.py
index c05e0ce0..d9254bda 100644
--- a/test/t/test_screen.py
+++ b/test/t/test_screen.py
@@ -2,7 +2,7 @@ import pytest
class TestScreen:
- @pytest.mark.complete("screen -")
+ @pytest.mark.complete("screen -", require_cmd=True)
def test_1(self, completion):
assert completion
@@ -22,3 +22,27 @@ class TestScreen:
@pytest.mark.complete("screen -T foo cat")
def test_5(self, completion):
assert completion
+
+ @pytest.mark.complete("screen //")
+ def test_telnet(self, completion):
+ assert completion == "//telnet"
+
+ @pytest.mark.complete("screen cat //")
+ def test_not_telnet(self, completion):
+ assert completion != "//telnet"
+
+ @pytest.mark.complete("screen //telnet ", env=dict(HOME="$PWD/shared"))
+ def test_telnet_first_arg(self, completion):
+ assert "bash-completion-canary-host.local" in completion
+
+ @pytest.mark.complete("screen //telnet foo ", env=dict(HOME="$PWD/shared"))
+ def test_telnet_other_args(self, completion):
+ assert not completion
+
+ @pytest.mark.complete("screen /dev/ttyUSB0 ")
+ def test_serial_2nd_arg(self, completion):
+ assert "19200" in completion
+
+ @pytest.mark.complete("screen /dev/ttyUSB0 9600 ")
+ def test_serial_3rdplus_arg(self, completion):
+ assert not completion
diff --git a/test/t/test_scrub.py b/test/t/test_scrub.py
index 0a521faf..5853ad2b 100644
--- a/test/t/test_scrub.py
+++ b/test/t/test_scrub.py
@@ -6,14 +6,14 @@ class TestScrub:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("scrub -")
+ @pytest.mark.complete("scrub -", require_cmd=True)
def test_2(self, completion):
assert completion
# Not all scrub versions list available patterns in --help output
@pytest.mark.complete(
"scrub -p ",
- skipif="! (scrub --help 2>&1 || :) | " "command grep -q ^Available",
+ xfail="! (scrub --help 2>&1 || :) | command grep -q ^Available",
)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_sed.py b/test/t/test_sed.py
index 3fc0559f..53079c9f 100644
--- a/test/t/test_sed.py
+++ b/test/t/test_sed.py
@@ -2,6 +2,6 @@ import pytest
class TestSed:
- @pytest.mark.complete("sed --", skipif="! sed --help &>/dev/null")
+ @pytest.mark.complete("sed --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_seq.py b/test/t/test_seq.py
index 96580450..b6722380 100644
--- a/test/t/test_seq.py
+++ b/test/t/test_seq.py
@@ -2,6 +2,6 @@ import pytest
class TestSeq:
- @pytest.mark.complete("seq --")
+ @pytest.mark.complete("seq --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_setquota.py b/test/t/test_setquota.py
index a2822bca..76fd7b9b 100644
--- a/test/t/test_setquota.py
+++ b/test/t/test_setquota.py
@@ -5,3 +5,7 @@ class TestSetquota:
@pytest.mark.complete("setquota ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("setquota -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_sftp.py b/test/t/test_sftp.py
index e76a6f59..0c039399 100644
--- a/test/t/test_sftp.py
+++ b/test/t/test_sftp.py
@@ -5,3 +5,7 @@ class TestSftp:
@pytest.mark.complete("sftp -Fsp", cwd="sftp")
def test_1(self, completion):
assert completion == "-Fspaced conf"
+
+ @pytest.mark.complete("sftp -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_sha1sum.py b/test/t/test_sha1sum.py
index efe8dfec..e4296d46 100644
--- a/test/t/test_sha1sum.py
+++ b/test/t/test_sha1sum.py
@@ -2,6 +2,6 @@ import pytest
class TestSha1sum:
- @pytest.mark.complete("sha1sum --")
+ @pytest.mark.complete("sha1sum --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_shar.py b/test/t/test_shar.py
index f73c4b87..5c23004e 100644
--- a/test/t/test_shar.py
+++ b/test/t/test_shar.py
@@ -2,6 +2,6 @@ import pytest
class TestShar:
- @pytest.mark.complete("shar --")
+ @pytest.mark.complete("shar --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_shellcheck.py b/test/t/test_shellcheck.py
index 54bc4636..703128f1 100644
--- a/test/t/test_shellcheck.py
+++ b/test/t/test_shellcheck.py
@@ -6,14 +6,14 @@ class TestShellcheck:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("shellcheck -")
+ @pytest.mark.complete("shellcheck -", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("shellcheck --format=")
+ @pytest.mark.complete("shellcheck --format=", require_cmd=True)
def test_3(self, completion):
assert completion
- @pytest.mark.complete("shellcheck -s ")
+ @pytest.mark.complete("shellcheck -s ", require_cmd=True)
def test_4(self, completion):
assert "bash" in completion
diff --git a/test/t/test_sitecopy.py b/test/t/test_sitecopy.py
index de66a5dc..afdeeaa8 100644
--- a/test/t/test_sitecopy.py
+++ b/test/t/test_sitecopy.py
@@ -2,6 +2,6 @@ import pytest
class TestSitecopy:
- @pytest.mark.complete("sitecopy --")
+ @pytest.mark.complete("sitecopy --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_slapt_get.py b/test/t/test_slapt_get.py
index 1254d5b4..626dde9e 100644
--- a/test/t/test_slapt_get.py
+++ b/test/t/test_slapt_get.py
@@ -3,11 +3,11 @@ import pytest
@pytest.mark.bashcomp(cmd="slapt-get")
class TestSlaptGet:
- @pytest.mark.complete("slapt-get -")
+ @pytest.mark.complete("slapt-get -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("slapt-get --up")
+ @pytest.mark.complete("slapt-get --up", require_cmd=True)
def test_2(self, completion):
assert completion == "--update --upgrade".split()
diff --git a/test/t/test_slapt_src.py b/test/t/test_slapt_src.py
index df5f4da0..dd443b04 100644
--- a/test/t/test_slapt_src.py
+++ b/test/t/test_slapt_src.py
@@ -3,14 +3,14 @@ import pytest
@pytest.mark.bashcomp(cmd="slapt-src")
class TestSlaptSrc:
- @pytest.mark.complete("slapt-src -")
+ @pytest.mark.complete("slapt-src -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("slapt-src --bu")
+ @pytest.mark.complete("slapt-src --bu", require_cmd=True)
def test_2(self, completion):
assert completion == "--build"
- @pytest.mark.complete("slapt-src --ins")
+ @pytest.mark.complete("slapt-src --ins", require_cmd=True)
def test_3(self, completion):
assert completion == "--install"
diff --git a/test/t/test_smartctl.py b/test/t/test_smartctl.py
index ac6dc68d..26d0147d 100644
--- a/test/t/test_smartctl.py
+++ b/test/t/test_smartctl.py
@@ -2,6 +2,6 @@ import pytest
class TestSmartctl:
- @pytest.mark.complete("smartctl --")
+ @pytest.mark.complete("smartctl --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_smbcacls.py b/test/t/test_smbcacls.py
index 1ff16e2b..0fe84e30 100644
--- a/test/t/test_smbcacls.py
+++ b/test/t/test_smbcacls.py
@@ -2,6 +2,6 @@ import pytest
class TestSmbcacls:
- @pytest.mark.complete("smbcacls -")
+ @pytest.mark.complete("smbcacls -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_smbclient.py b/test/t/test_smbclient.py
index ed2da4b0..250ab876 100644
--- a/test/t/test_smbclient.py
+++ b/test/t/test_smbclient.py
@@ -2,6 +2,6 @@ import pytest
class TestSmbclient:
- @pytest.mark.complete("smbclient -")
+ @pytest.mark.complete("smbclient -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_smbcquotas.py b/test/t/test_smbcquotas.py
index b7e01d29..16157ed7 100644
--- a/test/t/test_smbcquotas.py
+++ b/test/t/test_smbcquotas.py
@@ -2,6 +2,6 @@ import pytest
class TestSmbcquotas:
- @pytest.mark.complete("smbcquotas -")
+ @pytest.mark.complete("smbcquotas -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_smbget.py b/test/t/test_smbget.py
index a360bd3c..a6df717a 100644
--- a/test/t/test_smbget.py
+++ b/test/t/test_smbget.py
@@ -2,6 +2,6 @@ import pytest
class TestSmbget:
- @pytest.mark.complete("smbget -")
+ @pytest.mark.complete("smbget -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_smbpasswd.py b/test/t/test_smbpasswd.py
index 4d0e76ba..9fae8f26 100644
--- a/test/t/test_smbpasswd.py
+++ b/test/t/test_smbpasswd.py
@@ -2,6 +2,6 @@ import pytest
class TestSmbpasswd:
- @pytest.mark.complete("smbpasswd -")
+ @pytest.mark.complete("smbpasswd -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_smbtar.py b/test/t/test_smbtar.py
index 44b424bc..2a0e01e9 100644
--- a/test/t/test_smbtar.py
+++ b/test/t/test_smbtar.py
@@ -2,6 +2,6 @@ import pytest
class TestSmbtar:
- @pytest.mark.complete("smbtar -")
+ @pytest.mark.complete("smbtar -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_smbtree.py b/test/t/test_smbtree.py
index 0eba4b54..2cb6767e 100644
--- a/test/t/test_smbtree.py
+++ b/test/t/test_smbtree.py
@@ -2,6 +2,6 @@ import pytest
class TestSmbtree:
- @pytest.mark.complete("smbtree -")
+ @pytest.mark.complete("smbtree -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_snownews.py b/test/t/test_snownews.py
index 24ed2dfe..a05df98d 100644
--- a/test/t/test_snownews.py
+++ b/test/t/test_snownews.py
@@ -2,6 +2,6 @@ import pytest
class TestSnownews:
- @pytest.mark.complete("snownews --")
+ @pytest.mark.complete("snownews --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_sort.py b/test/t/test_sort.py
index 7dbb5b9d..d1a4e369 100644
--- a/test/t/test_sort.py
+++ b/test/t/test_sort.py
@@ -2,6 +2,6 @@ import pytest
class TestSort:
- @pytest.mark.complete("sort --")
+ @pytest.mark.complete("sort --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_split.py b/test/t/test_split.py
index 79013663..8c3f1f4c 100644
--- a/test/t/test_split.py
+++ b/test/t/test_split.py
@@ -2,6 +2,6 @@ import pytest
class TestSplit:
- @pytest.mark.complete("split --", skipif="! split --help &>/dev/null")
+ @pytest.mark.complete("split --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_sqlite3.py b/test/t/test_sqlite3.py
index 466281a9..69a13162 100644
--- a/test/t/test_sqlite3.py
+++ b/test/t/test_sqlite3.py
@@ -6,10 +6,10 @@ class TestSqlite3:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("sqlite3 -")
+ @pytest.mark.complete("sqlite3 -", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("sqlite3 -scratch foo ")
+ @pytest.mark.complete("sqlite3 -scratch foo ", require_cmd=True)
def test_3(self, completion):
assert not completion
diff --git a/test/t/test_ss.py b/test/t/test_ss.py
index 3e515dde..716c0fd7 100644
--- a/test/t/test_ss.py
+++ b/test/t/test_ss.py
@@ -2,14 +2,14 @@ import pytest
class TestSs:
- @pytest.mark.complete("ss -")
+ @pytest.mark.complete("ss -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("ss -A ")
+ @pytest.mark.complete("ss -A ", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("ss -A foo,")
+ @pytest.mark.complete("ss -A foo,", require_cmd=True)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py
index 97a4a733..204b7c7c 100644
--- a/test/t/test_ssh.py
+++ b/test/t/test_ssh.py
@@ -28,3 +28,7 @@ class TestSsh:
@pytest.mark.complete("ssh -vo userknownhostsf")
def test_5(self, completion):
assert "UserKnownHostsFile=" in completion
+
+ @pytest.mark.complete("ssh -", require_cmd=True)
+ def test_6(self, completion):
+ assert completion
diff --git a/test/t/test_ssh_add.py b/test/t/test_ssh_add.py
index 33e679c7..7e493724 100644
--- a/test/t/test_ssh_add.py
+++ b/test/t/test_ssh_add.py
@@ -6,3 +6,12 @@ class TestSshAdd:
@pytest.mark.complete("ssh-add ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete(
+ "ssh-add -",
+ require_cmd=True,
+ xfail="ssh-add --help 2>&1 | "
+ "command grep -qiF 'Could not open a connection'",
+ )
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_ssh_copy_id.py b/test/t/test_ssh_copy_id.py
index cb607715..e38e9014 100644
--- a/test/t/test_ssh_copy_id.py
+++ b/test/t/test_ssh_copy_id.py
@@ -11,6 +11,6 @@ import pytest
ignore_env=r"^[+-]_scp_path_esc=",
)
class TestSshCopyId:
- @pytest.mark.complete("ssh-copy-id -")
+ @pytest.mark.complete("ssh-copy-id -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ssh_keygen.py b/test/t/test_ssh_keygen.py
index 628672d4..2d53f5f8 100644
--- a/test/t/test_ssh_keygen.py
+++ b/test/t/test_ssh_keygen.py
@@ -3,6 +3,6 @@ import pytest
@pytest.mark.bashcomp(cmd="ssh-keygen")
class TestSshKeygen:
- @pytest.mark.complete("ssh-keygen -")
+ @pytest.mark.complete("ssh-keygen -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_sshmitm.py b/test/t/test_sshmitm.py
index 9964c5b5..671fcf52 100644
--- a/test/t/test_sshmitm.py
+++ b/test/t/test_sshmitm.py
@@ -2,6 +2,6 @@ import pytest
class TestSshmitm:
- @pytest.mark.complete("sshmitm -")
+ @pytest.mark.complete("sshmitm -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_sshow.py b/test/t/test_sshow.py
index b6811e0c..563bc6b4 100644
--- a/test/t/test_sshow.py
+++ b/test/t/test_sshow.py
@@ -2,6 +2,6 @@ import pytest
class TestSshow:
- @pytest.mark.complete("sshow -")
+ @pytest.mark.complete("sshow -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_strace.py b/test/t/test_strace.py
index b9dbfaca..e0d6aedf 100644
--- a/test/t/test_strace.py
+++ b/test/t/test_strace.py
@@ -2,6 +2,6 @@ import pytest
class TestStrace:
- @pytest.mark.complete("strace -")
+ @pytest.mark.complete("strace -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_strings.py b/test/t/test_strings.py
index 3922ecef..6b5d0124 100644
--- a/test/t/test_strings.py
+++ b/test/t/test_strings.py
@@ -5,3 +5,7 @@ class TestStrings:
@pytest.mark.complete("strings ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("strings -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_strip.py b/test/t/test_strip.py
index c756fe03..105012fd 100644
--- a/test/t/test_strip.py
+++ b/test/t/test_strip.py
@@ -2,6 +2,6 @@ import pytest
class TestStrip:
- @pytest.mark.complete("strip --")
+ @pytest.mark.complete("strip --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_su.py b/test/t/test_su.py
index e6c5ef4b..9aa064dd 100644
--- a/test/t/test_su.py
+++ b/test/t/test_su.py
@@ -5,3 +5,7 @@ class TestSu:
@pytest.mark.complete("su ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("su -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_sudo.py b/test/t/test_sudo.py
index 761c5604..ced6662e 100644
--- a/test/t/test_sudo.py
+++ b/test/t/test_sudo.py
@@ -4,7 +4,7 @@ from conftest import assert_complete
class TestSudo:
- @pytest.mark.complete("sudo -")
+ @pytest.mark.complete("sudo -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_sum.py b/test/t/test_sum.py
new file mode 100644
index 00000000..bfb2cf4e
--- /dev/null
+++ b/test/t/test_sum.py
@@ -0,0 +1,11 @@
+import pytest
+
+
+class TestSum:
+ @pytest.mark.complete("sum ")
+ def test_1(self, completion):
+ assert completion
+
+ @pytest.mark.complete("sum -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_synclient.py b/test/t/test_synclient.py
index 23138294..8a31a654 100644
--- a/test/t/test_synclient.py
+++ b/test/t/test_synclient.py
@@ -5,10 +5,12 @@ class TestSynclient:
# synclient -l may error out with e.g.
# "Couldn't find synaptics properties. No synaptics driver loaded?"
- @pytest.mark.complete("synclient ", skipif="! synclient -l &>/dev/null")
+ @pytest.mark.complete(
+ "synclient ", require_cmd=True, xfail="! synclient -l &>/dev/null"
+ )
def test_1(self, completion):
assert completion
- @pytest.mark.complete("synclient -")
+ @pytest.mark.complete("synclient -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_sysbench.py b/test/t/test_sysbench.py
index afe21eca..4992d8a6 100644
--- a/test/t/test_sysbench.py
+++ b/test/t/test_sysbench.py
@@ -2,6 +2,10 @@ import pytest
class TestSysbench:
- @pytest.mark.complete("sysbench ")
+ @pytest.mark.complete("sysbench ", require_cmd=True)
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("sysbench -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_sysctl.py b/test/t/test_sysctl.py
index 773b5910..f8db50bd 100644
--- a/test/t/test_sysctl.py
+++ b/test/t/test_sysctl.py
@@ -2,13 +2,14 @@ import pytest
class TestSysctl:
- @pytest.mark.complete("sysctl -")
+ @pytest.mark.complete("sysctl -", require_cmd=True)
def test_1(self, completion):
assert completion
@pytest.mark.complete(
"sysctl kern",
- skipif="! sysctl -N -a 2>/dev/null | " "command grep -q ^kern",
+ require_cmd=True,
+ xfail="! sysctl -N -a 2>/dev/null | command grep -q ^kern",
)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_tac.py b/test/t/test_tac.py
index f612cc90..db433cc9 100644
--- a/test/t/test_tac.py
+++ b/test/t/test_tac.py
@@ -2,6 +2,6 @@ import pytest
class TestTac:
- @pytest.mark.complete("tac --")
+ @pytest.mark.complete("tac --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_tail.py b/test/t/test_tail.py
index 1b818f7d..6f2b3c61 100644
--- a/test/t/test_tail.py
+++ b/test/t/test_tail.py
@@ -2,6 +2,6 @@ import pytest
class TestTail:
- @pytest.mark.complete("tail --", skipif="! tail --help &>/dev/null")
+ @pytest.mark.complete("tail --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_tcpdump.py b/test/t/test_tcpdump.py
index ec26187f..a5573640 100644
--- a/test/t/test_tcpdump.py
+++ b/test/t/test_tcpdump.py
@@ -2,6 +2,6 @@ import pytest
class TestTcpdump:
- @pytest.mark.complete("tcpdump -")
+ @pytest.mark.complete("tcpdump -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_tcpnice.py b/test/t/test_tcpnice.py
index c7d208d1..fbe95922 100644
--- a/test/t/test_tcpnice.py
+++ b/test/t/test_tcpnice.py
@@ -2,6 +2,6 @@ import pytest
class TestTcpnice:
- @pytest.mark.complete("tcpnice -")
+ @pytest.mark.complete("tcpnice -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_tee.py b/test/t/test_tee.py
index b0914624..3d8bcd7d 100644
--- a/test/t/test_tee.py
+++ b/test/t/test_tee.py
@@ -5,3 +5,7 @@ class TestTee:
@pytest.mark.complete("tee ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("tee -", require_longopt=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_texindex.py b/test/t/test_texindex.py
index 4a2387ff..c3f6a0b1 100644
--- a/test/t/test_texindex.py
+++ b/test/t/test_texindex.py
@@ -2,6 +2,6 @@ import pytest
class TestTexindex:
- @pytest.mark.complete("texindex --")
+ @pytest.mark.complete("texindex --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_timeout.py b/test/t/test_timeout.py
index 6b5ac5f0..46fe2e00 100644
--- a/test/t/test_timeout.py
+++ b/test/t/test_timeout.py
@@ -6,6 +6,6 @@ class TestTimeout:
def test_1(self, completion):
assert not completion
- @pytest.mark.complete("timeout -")
+ @pytest.mark.complete("timeout -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_touch.py b/test/t/test_touch.py
index cc398d81..8a49e500 100644
--- a/test/t/test_touch.py
+++ b/test/t/test_touch.py
@@ -2,6 +2,6 @@ import pytest
class TestTouch:
- @pytest.mark.complete("touch --", skipif="! touch --help &>/dev/null")
+ @pytest.mark.complete("touch --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_tox.py b/test/t/test_tox.py
index b6149362..f012a032 100644
--- a/test/t/test_tox.py
+++ b/test/t/test_tox.py
@@ -6,10 +6,14 @@ class TestTox:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("tox -e ")
+ @pytest.mark.complete("tox -e ", cwd="tox")
def test_2(self, completion):
- assert completion == "ALL"
+ assert all(x in completion for x in "py37 ALL".split())
- @pytest.mark.complete("tox -e foo,")
+ @pytest.mark.complete("tox -e foo,", cwd="tox")
def test_3(self, completion):
- assert completion == "foo,ALL"
+ assert all(x in completion for x in "py37 ALL".split())
+
+ @pytest.mark.complete("tox -e foo -- ", cwd="tox")
+ def test_default_after_dashdash(self, completion):
+ assert "tox.ini" in completion
diff --git a/test/t/test_tr.py b/test/t/test_tr.py
index 84597012..0a51e9e4 100644
--- a/test/t/test_tr.py
+++ b/test/t/test_tr.py
@@ -2,6 +2,6 @@ import pytest
class TestTr:
- @pytest.mark.complete("tr --", skipif="! tr --help &>/dev/null")
+ @pytest.mark.complete("tr --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_tracepath.py b/test/t/test_tracepath.py
index a6ef7a41..e4cac656 100644
--- a/test/t/test_tracepath.py
+++ b/test/t/test_tracepath.py
@@ -6,6 +6,6 @@ class TestTracepath:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("tracepath -")
+ @pytest.mark.complete("tracepath -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_tshark.py b/test/t/test_tshark.py
index 6505e6a8..8ed881ee 100644
--- a/test/t/test_tshark.py
+++ b/test/t/test_tshark.py
@@ -3,25 +3,25 @@ import pytest
@pytest.mark.bashcomp(ignore_env=r"^\+_tshark_pr(ef|otocol)s=")
class TestTshark:
- @pytest.mark.complete("tshark -")
+ @pytest.mark.complete("tshark -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("tshark -G ")
+ @pytest.mark.complete("tshark -G ", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("tshark -O foo,htt")
+ @pytest.mark.complete("tshark -O foo,htt", require_cmd=True)
def test_3(self, completion):
# When there's only one completion, it's be the one with "foo," prefix;
# when multiple (e.g. http and http2), it's the completion alone.
assert completion == "foo,http" or "http" in completion
- @pytest.mark.complete("tshark -o tcp")
+ @pytest.mark.complete("tshark -o tcp", require_cmd=True)
def test_4(self, completion):
assert "tcp.desegment_tcp_streams:" in completion
- @pytest.mark.complete("tshark -otcp")
+ @pytest.mark.complete("tshark -otcp", require_cmd=True)
def test_5(self, completion):
assert "-otcp.desegment_tcp_streams:" in completion
diff --git a/test/t/test_tune2fs.py b/test/t/test_tune2fs.py
index c8f4e873..5cc0e41e 100644
--- a/test/t/test_tune2fs.py
+++ b/test/t/test_tune2fs.py
@@ -5,3 +5,7 @@ class TestTune2fs:
@pytest.mark.complete("tune2fs ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("tune2fs -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_udevadm.py b/test/t/test_udevadm.py
index d5dcddbb..6191c770 100644
--- a/test/t/test_udevadm.py
+++ b/test/t/test_udevadm.py
@@ -2,6 +2,10 @@ import pytest
class TestUdevadm:
- @pytest.mark.complete("udevadm ")
+ @pytest.mark.complete("udevadm ", require_cmd=True)
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("udevadm -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_ulimit.py b/test/t/test_ulimit.py
index 24785beb..3ab974cf 100644
--- a/test/t/test_ulimit.py
+++ b/test/t/test_ulimit.py
@@ -6,7 +6,7 @@ class TestUlimit:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("ulimit -")
+ @pytest.mark.complete("ulimit -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_uname.py b/test/t/test_uname.py
index 743f317c..e71a4334 100644
--- a/test/t/test_uname.py
+++ b/test/t/test_uname.py
@@ -2,6 +2,6 @@ import pytest
class TestUname:
- @pytest.mark.complete("uname --", skipif="! uname --help &>/dev/null")
+ @pytest.mark.complete("uname --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_unexpand.py b/test/t/test_unexpand.py
index 6b77b3bb..2f1359b4 100644
--- a/test/t/test_unexpand.py
+++ b/test/t/test_unexpand.py
@@ -2,8 +2,6 @@ import pytest
class TestUnexpand:
- @pytest.mark.complete(
- "unexpand --", skipif="! unexpand --help &>/dev/null"
- )
+ @pytest.mark.complete("unexpand --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_uniq.py b/test/t/test_uniq.py
index 8647c615..73691fd8 100644
--- a/test/t/test_uniq.py
+++ b/test/t/test_uniq.py
@@ -2,6 +2,6 @@ import pytest
class TestUniq:
- @pytest.mark.complete("uniq --", skipif="! uniq --help &>/dev/null")
+ @pytest.mark.complete("uniq --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_units.py b/test/t/test_units.py
index aa1f89c8..824e2ce4 100644
--- a/test/t/test_units.py
+++ b/test/t/test_units.py
@@ -2,6 +2,8 @@ import pytest
class TestUnits:
- @pytest.mark.complete("units --", skipif="! units --help &>/dev/null")
+ @pytest.mark.complete(
+ "units --", require_cmd=True, xfail="! units --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_unshunt.py b/test/t/test_unshunt.py
index 966312ed..a354239e 100644
--- a/test/t/test_unshunt.py
+++ b/test/t/test_unshunt.py
@@ -2,6 +2,6 @@ import pytest
class TestUnshunt:
- @pytest.mark.complete("unshunt --")
+ @pytest.mark.complete("unshunt --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_update_alternatives.py b/test/t/test_update_alternatives.py
index 1209bebf..7c777307 100644
--- a/test/t/test_update_alternatives.py
+++ b/test/t/test_update_alternatives.py
@@ -3,6 +3,6 @@ import pytest
@pytest.mark.bashcomp(cmd="update-alternatives")
class TestUpdateAlternatives:
- @pytest.mark.complete("update-alternatives --")
+ @pytest.mark.complete("update-alternatives --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_upgradepkg.py b/test/t/test_upgradepkg.py
index ada84f1c..4c72a158 100644
--- a/test/t/test_upgradepkg.py
+++ b/test/t/test_upgradepkg.py
@@ -22,12 +22,12 @@ class TestUpgradepkg:
[
"%s/" % x
for x in os.listdir("slackware/home")
- if os.path.isdir("./%s" % x)
+ if os.path.isdir("./slackware/home/%s" % x)
]
+ [
x
for x in os.listdir("slackware/home")
- if os.path.isfile("./%s" % x)
+ if os.path.isfile("./slackware/home/%s" % x)
and fnmatch.fnmatch(x, "*.t[bglx]z")
]
)
diff --git a/test/t/test_urlsnarf.py b/test/t/test_urlsnarf.py
index a9482113..8551c60c 100644
--- a/test/t/test_urlsnarf.py
+++ b/test/t/test_urlsnarf.py
@@ -2,6 +2,6 @@ import pytest
class TestUrlsnarf:
- @pytest.mark.complete("urlsnarf -")
+ @pytest.mark.complete("urlsnarf -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_uscan.py b/test/t/test_uscan.py
index 5f4c684a..142c3250 100644
--- a/test/t/test_uscan.py
+++ b/test/t/test_uscan.py
@@ -2,6 +2,6 @@ import pytest
class TestUscan:
- @pytest.mark.complete("uscan -")
+ @pytest.mark.complete("uscan -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_useradd.py b/test/t/test_useradd.py
index 557d4a91..5cbf6ce4 100644
--- a/test/t/test_useradd.py
+++ b/test/t/test_useradd.py
@@ -6,6 +6,6 @@ class TestUseradd:
def test_1(self, completion):
assert not completion
- @pytest.mark.complete("useradd -")
+ @pytest.mark.complete("useradd -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_userdel.py b/test/t/test_userdel.py
index 74003eb1..718c6629 100644
--- a/test/t/test_userdel.py
+++ b/test/t/test_userdel.py
@@ -2,7 +2,7 @@ import pytest
class TestUserdel:
- @pytest.mark.complete("userdel -")
+ @pytest.mark.complete("userdel -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_usermod.py b/test/t/test_usermod.py
index 1eb169c7..ef3dd5aa 100644
--- a/test/t/test_usermod.py
+++ b/test/t/test_usermod.py
@@ -6,6 +6,6 @@ class TestUsermod:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("usermod -")
+ @pytest.mark.complete("usermod -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_valgrind.py b/test/t/test_valgrind.py
index 2b03d6f9..c7c979dd 100644
--- a/test/t/test_valgrind.py
+++ b/test/t/test_valgrind.py
@@ -10,15 +10,17 @@ class TestValgrind:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("valgrind -")
+ @pytest.mark.complete("valgrind -", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("valgrind --tool=memche")
+ @pytest.mark.complete("valgrind --tool=memche", require_cmd=True)
def test_3(self, completion):
assert "--tool=memcheck" in completion
- @pytest.mark.complete("valgrind --tool=helgrind --history-l")
+ @pytest.mark.complete(
+ "valgrind --tool=helgrind --history-l", require_cmd=True
+ )
def test_4(self, completion):
assert "--history-level=" in completion
assert not completion.endswith(" ")
diff --git a/test/t/test_vdir.py b/test/t/test_vdir.py
index 2f6a744e..e1869896 100644
--- a/test/t/test_vdir.py
+++ b/test/t/test_vdir.py
@@ -5,3 +5,7 @@ class TestVdir:
@pytest.mark.complete("vdir ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("vdir -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_vgcfgbackup.py b/test/t/test_vgcfgbackup.py
index 20ef09cc..2e6c6f1d 100644
--- a/test/t/test_vgcfgbackup.py
+++ b/test/t/test_vgcfgbackup.py
@@ -3,7 +3,9 @@ import pytest
class TestVgcfgbackup:
@pytest.mark.complete(
- "vgcfgbackup -", skipif="! vgcfgbackup --help &>/dev/null"
+ "vgcfgbackup -",
+ require_cmd=True,
+ xfail="! vgcfgbackup --help &>/dev/null",
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgcfgrestore.py b/test/t/test_vgcfgrestore.py
index 26096555..acb1a38f 100644
--- a/test/t/test_vgcfgrestore.py
+++ b/test/t/test_vgcfgrestore.py
@@ -3,7 +3,9 @@ import pytest
class TestVgcfgrestore:
@pytest.mark.complete(
- "vgcfgrestore -", skipif="! vgcfgrestore --help &>/dev/null"
+ "vgcfgrestore -",
+ require_cmd=True,
+ xfail="! vgcfgrestore --help &>/dev/null",
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgchange.py b/test/t/test_vgchange.py
index 0e268bad..ed14f2a7 100644
--- a/test/t/test_vgchange.py
+++ b/test/t/test_vgchange.py
@@ -2,6 +2,8 @@ import pytest
class TestVgchange:
- @pytest.mark.complete("vgchange -")
+ @pytest.mark.complete(
+ "vgchange -", require_cmd=True, xfail="! vgchange --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgck.py b/test/t/test_vgck.py
index 347f8f9b..52ddf886 100644
--- a/test/t/test_vgck.py
+++ b/test/t/test_vgck.py
@@ -2,6 +2,8 @@ import pytest
class TestVgck:
- @pytest.mark.complete("vgck -", skipif="! vgck --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgck -", require_cmd=True, xfail="! vgck --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgconvert.py b/test/t/test_vgconvert.py
index 9810bc2f..029fe486 100644
--- a/test/t/test_vgconvert.py
+++ b/test/t/test_vgconvert.py
@@ -3,7 +3,7 @@ import pytest
class TestVgconvert:
@pytest.mark.complete(
- "vgconvert -", skipif="! vgconvert --help &>/dev/null"
+ "vgconvert -", require_cmd=True, xfail="! vgconvert --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgcreate.py b/test/t/test_vgcreate.py
index 07518e58..40c17734 100644
--- a/test/t/test_vgcreate.py
+++ b/test/t/test_vgcreate.py
@@ -2,10 +2,12 @@ import pytest
class TestVgcreate:
- @pytest.mark.complete("vgcreate -")
+ @pytest.mark.complete(
+ "vgcreate -", require_cmd=True, xfail="! vgcreate --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
- @pytest.mark.complete("vgcreate __does_not_exist__")
+ @pytest.mark.complete("vgcreate __does_not_exist__", require_cmd=True)
def test_2(self, completion):
assert not completion
diff --git a/test/t/test_vgdisplay.py b/test/t/test_vgdisplay.py
index a6919a6c..60667292 100644
--- a/test/t/test_vgdisplay.py
+++ b/test/t/test_vgdisplay.py
@@ -3,7 +3,7 @@ import pytest
class TestVgdisplay:
@pytest.mark.complete(
- "vgdisplay -", skipif="! vgdisplay --help &>/dev/null"
+ "vgdisplay -", require_cmd=True, xfail="! vgdisplay --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgexport.py b/test/t/test_vgexport.py
index ce9a93bf..96ecc3cd 100644
--- a/test/t/test_vgexport.py
+++ b/test/t/test_vgexport.py
@@ -2,6 +2,8 @@ import pytest
class TestVgexport:
- @pytest.mark.complete("vgexport -", skipif="! vgexport --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgexport -", require_cmd=True, xfail="! vgexport --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgextend.py b/test/t/test_vgextend.py
index 3d3347f1..8c41ab60 100644
--- a/test/t/test_vgextend.py
+++ b/test/t/test_vgextend.py
@@ -2,6 +2,8 @@ import pytest
class TestVgextend:
- @pytest.mark.complete("vgextend -", skipif="! vgextend --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgextend -", require_cmd=True, xfail="! vgextend --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgimport.py b/test/t/test_vgimport.py
index 1a3efab0..24017d2b 100644
--- a/test/t/test_vgimport.py
+++ b/test/t/test_vgimport.py
@@ -2,6 +2,8 @@ import pytest
class TestVgimport:
- @pytest.mark.complete("vgimport -", skipif="! vgimport --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgimport -", require_cmd=True, xfail="! vgimport --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgmerge.py b/test/t/test_vgmerge.py
index 971eb69a..7d889321 100644
--- a/test/t/test_vgmerge.py
+++ b/test/t/test_vgmerge.py
@@ -2,6 +2,8 @@ import pytest
class TestVgmerge:
- @pytest.mark.complete("vgmerge -", skipif="! vgmerge --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgmerge -", require_cmd=True, xfail="! vgmerge --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgmknodes.py b/test/t/test_vgmknodes.py
index 3209de9f..7e046f05 100644
--- a/test/t/test_vgmknodes.py
+++ b/test/t/test_vgmknodes.py
@@ -3,7 +3,7 @@ import pytest
class TestVgmknodes:
@pytest.mark.complete(
- "vgmknodes -", skipif="! vgmknodes --help &>/dev/null"
+ "vgmknodes -", require_cmd=True, xfail="! vgmknodes --help &>/dev/null"
)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgreduce.py b/test/t/test_vgreduce.py
index 97641b42..26174b95 100644
--- a/test/t/test_vgreduce.py
+++ b/test/t/test_vgreduce.py
@@ -2,6 +2,8 @@ import pytest
class TestVgreduce:
- @pytest.mark.complete("vgreduce -", skipif="! vgreduce --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgreduce -", require_cmd=True, xfail="! vgreduce --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgremove.py b/test/t/test_vgremove.py
index 9c47752c..637d5c3f 100644
--- a/test/t/test_vgremove.py
+++ b/test/t/test_vgremove.py
@@ -2,6 +2,8 @@ import pytest
class TestVgremove:
- @pytest.mark.complete("vgremove -", skipif="! vgremove --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgremove -", require_cmd=True, xfail="! vgremove --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgrename.py b/test/t/test_vgrename.py
index ea5bc050..87a6a727 100644
--- a/test/t/test_vgrename.py
+++ b/test/t/test_vgrename.py
@@ -2,6 +2,8 @@ import pytest
class TestVgrename:
- @pytest.mark.complete("vgrename -", skipif="! vgrename --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgrename -", require_cmd=True, xfail="! vgrename --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgs.py b/test/t/test_vgs.py
index d492fe8d..e0d8a033 100644
--- a/test/t/test_vgs.py
+++ b/test/t/test_vgs.py
@@ -2,6 +2,8 @@ import pytest
class TestVgs:
- @pytest.mark.complete("vgs -", skipif="! vgs --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgs -", require_cmd=True, xfail="! vgs --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgscan.py b/test/t/test_vgscan.py
index 061ff4e2..95a4026c 100644
--- a/test/t/test_vgscan.py
+++ b/test/t/test_vgscan.py
@@ -2,6 +2,8 @@ import pytest
class TestVgscan:
- @pytest.mark.complete("vgscan -", skipif="! vgscan --help &>/dev/null")
+ @pytest.mark.complete(
+ "vgscan -", require_cmd=True, xfail="! vgscan --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vgsplit.py b/test/t/test_vgsplit.py
index 7b5a6869..1c3dfa85 100644
--- a/test/t/test_vgsplit.py
+++ b/test/t/test_vgsplit.py
@@ -2,6 +2,8 @@ import pytest
class TestVgsplit:
- @pytest.mark.complete("vgsplit -")
+ @pytest.mark.complete(
+ "vgsplit -", require_cmd=True, xfail="! vgsplit --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vipw.py b/test/t/test_vipw.py
index 160cb11b..07b454bf 100644
--- a/test/t/test_vipw.py
+++ b/test/t/test_vipw.py
@@ -2,6 +2,6 @@ import pytest
class TestVipw:
- @pytest.mark.complete("vipw -")
+ @pytest.mark.complete("vipw -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vmstat.py b/test/t/test_vmstat.py
index 47b55f6f..b7145ff3 100644
--- a/test/t/test_vmstat.py
+++ b/test/t/test_vmstat.py
@@ -2,6 +2,6 @@ import pytest
class TestVmstat:
- @pytest.mark.complete("vmstat -")
+ @pytest.mark.complete("vmstat -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_vpnc.py b/test/t/test_vpnc.py
index 29a120a4..dac5b15b 100644
--- a/test/t/test_vpnc.py
+++ b/test/t/test_vpnc.py
@@ -8,6 +8,6 @@ import pytest
pre_cmds=("PATH=/usr/sbin:$PATH",)
)
class TestVpnc:
- @pytest.mark.complete("vpnc -")
+ @pytest.mark.complete("vpnc -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_watch.py b/test/t/test_watch.py
index 8387ae0a..b1de7f55 100644
--- a/test/t/test_watch.py
+++ b/test/t/test_watch.py
@@ -2,6 +2,6 @@ import pytest
class TestWatch:
- @pytest.mark.complete("watch -")
+ @pytest.mark.complete("watch -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_wc.py b/test/t/test_wc.py
index eb7b5a85..1f83ea7f 100644
--- a/test/t/test_wc.py
+++ b/test/t/test_wc.py
@@ -2,6 +2,6 @@ import pytest
class TestWc:
- @pytest.mark.complete("wc --", skipif="! wc --help &>/dev/null")
+ @pytest.mark.complete("wc --", require_longopt=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_webmitm.py b/test/t/test_webmitm.py
index e9f85940..d631dcf0 100644
--- a/test/t/test_webmitm.py
+++ b/test/t/test_webmitm.py
@@ -2,6 +2,6 @@ import pytest
class TestWebmitm:
- @pytest.mark.complete("webmitm -")
+ @pytest.mark.complete("webmitm -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_wget.py b/test/t/test_wget.py
index f8af4fb3..de752c26 100644
--- a/test/t/test_wget.py
+++ b/test/t/test_wget.py
@@ -6,6 +6,6 @@ class TestWget:
def test_1(self, completion):
assert not completion
- @pytest.mark.complete("wget --h")
+ @pytest.mark.complete("wget --s", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_who.py b/test/t/test_who.py
index d1f29ea7..9131ac76 100644
--- a/test/t/test_who.py
+++ b/test/t/test_who.py
@@ -2,6 +2,8 @@ import pytest
class TestWho:
- @pytest.mark.complete("who --", skipif="! who --help &>/dev/null")
+ @pytest.mark.complete(
+ "who --", require_cmd=True, xfail="! who --help &>/dev/null"
+ )
def test_1(self, completion):
assert completion
diff --git a/test/t/test_wol.py b/test/t/test_wol.py
index 8a6bea21..b7a622ee 100644
--- a/test/t/test_wol.py
+++ b/test/t/test_wol.py
@@ -13,3 +13,7 @@ class TestWol:
@pytest.mark.complete("wol 00:")
def test_2(self, completion):
assert completion == "00:00:00:00:00:00"
+
+ @pytest.mark.complete("wol -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_wsimport.py b/test/t/test_wsimport.py
index b75bf0f7..8c27f4bd 100644
--- a/test/t/test_wsimport.py
+++ b/test/t/test_wsimport.py
@@ -5,3 +5,14 @@ class TestWsimport:
@pytest.mark.complete("wsimport ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete(
+ "wsimport -",
+ require_cmd=True,
+ xfail=(
+ "! (wsimport -help 2>&1 || :) | "
+ "command grep -q -- '[[:space:]]-'"
+ ),
+ )
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_wtf.py b/test/t/test_wtf.py
index 6b2c9745..45dfcfd2 100644
--- a/test/t/test_wtf.py
+++ b/test/t/test_wtf.py
@@ -2,6 +2,7 @@ import pytest
class TestWtf:
- @pytest.mark.complete("wtf A")
+ # TODO: actually requires an acronym db, not the cmd
+ @pytest.mark.complete("wtf A", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_wvdial.py b/test/t/test_wvdial.py
index 19043f61..bbc520de 100644
--- a/test/t/test_wvdial.py
+++ b/test/t/test_wvdial.py
@@ -2,6 +2,6 @@ import pytest
class TestWvdial:
- @pytest.mark.complete("wvdial -")
+ @pytest.mark.complete("wvdial -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_xdg_settings.py b/test/t/test_xdg_settings.py
index a50df579..1a194592 100644
--- a/test/t/test_xdg_settings.py
+++ b/test/t/test_xdg_settings.py
@@ -7,10 +7,10 @@ class TestXdgSettings:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("xdg-settings --")
+ @pytest.mark.complete("xdg-settings --", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("xdg-settings get ")
+ @pytest.mark.complete("xdg-settings get ", require_cmd=True)
def test_3(self, completion):
assert completion
diff --git a/test/t/test_xfreerdp.py b/test/t/test_xfreerdp.py
index fdad1926..a8435d6c 100644
--- a/test/t/test_xfreerdp.py
+++ b/test/t/test_xfreerdp.py
@@ -17,30 +17,30 @@ class TestXfreerdp:
if "/help" in self._help(bash):
pytest.skip("Not dash syntax")
- @pytest.mark.complete("xfreerdp /")
+ @pytest.mark.complete("xfreerdp /", require_cmd=True)
def test_1(self, bash, completion, slash_syntax):
assert completion
- @pytest.mark.complete("xfreerdp -")
+ @pytest.mark.complete("xfreerdp -", require_cmd=True)
def test_2(self, completion):
assert completion
- @pytest.mark.complete("xfreerdp +")
+ @pytest.mark.complete("xfreerdp +", require_cmd=True)
def test_3(self, bash, completion, slash_syntax):
assert completion
- @pytest.mark.complete("xfreerdp /kbd:")
+ @pytest.mark.complete("xfreerdp /kbd:", require_cmd=True)
def test_4(self, bash, completion, slash_syntax):
assert completion
- @pytest.mark.complete("xfreerdp /help ")
+ @pytest.mark.complete("xfreerdp /help ", require_cmd=True)
def test_5(self, completion):
assert not completion
- @pytest.mark.complete("xfreerdp -k ")
+ @pytest.mark.complete("xfreerdp -k ", require_cmd=True)
def test_6(self, bash, completion, dash_syntax):
assert completion
- @pytest.mark.complete("xfreerdp --help ")
+ @pytest.mark.complete("xfreerdp --help ", require_cmd=True)
def test_7(self, completion):
assert not completion
diff --git a/test/t/test_xgamma.py b/test/t/test_xgamma.py
index 56c9440d..beb684f8 100644
--- a/test/t/test_xgamma.py
+++ b/test/t/test_xgamma.py
@@ -2,11 +2,11 @@ import pytest
class TestXgamma:
- @pytest.mark.complete("xgamma -")
+ @pytest.mark.complete("xgamma -", require_cmd=True)
def test_1(self, completion):
assert completion
- @pytest.mark.complete("xgamma -gam")
+ @pytest.mark.complete("xgamma -gam", require_cmd=True)
def test_2(self, completion):
assert completion == "-gamma"
assert completion.endswith(" ")
diff --git a/test/t/test_xmllint.py b/test/t/test_xmllint.py
index 0c0ebbcd..21c52c7c 100644
--- a/test/t/test_xmllint.py
+++ b/test/t/test_xmllint.py
@@ -6,6 +6,6 @@ class TestXmllint:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("xmllint -")
+ @pytest.mark.complete("xmllint -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_xmlwf.py b/test/t/test_xmlwf.py
index 8751f865..901f78af 100644
--- a/test/t/test_xmlwf.py
+++ b/test/t/test_xmlwf.py
@@ -5,3 +5,7 @@ class TestXmlwf:
@pytest.mark.complete("xmlwf ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("xmlwf -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_xmms.py b/test/t/test_xmms.py
index 1c96e2b5..a880b166 100644
--- a/test/t/test_xmms.py
+++ b/test/t/test_xmms.py
@@ -2,7 +2,7 @@ import pytest
class TestXmms:
- @pytest.mark.complete("xmms --")
+ @pytest.mark.complete("xmms --", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_xmodmap.py b/test/t/test_xmodmap.py
index d6d0ceae..cc33d737 100644
--- a/test/t/test_xmodmap.py
+++ b/test/t/test_xmodmap.py
@@ -6,6 +6,6 @@ class TestXmodmap:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("xmodmap -")
+ @pytest.mark.complete("xmodmap -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_xrandr.py b/test/t/test_xrandr.py
index e4e0d6b7..e7669224 100644
--- a/test/t/test_xrandr.py
+++ b/test/t/test_xrandr.py
@@ -2,10 +2,14 @@ import pytest
class TestXrandr:
- @pytest.mark.complete("xrandr ")
+ @pytest.mark.complete("xrandr ", require_cmd=True)
def test_1(self, completion):
assert completion
@pytest.mark.complete("xrandr --mode ")
def test_2(self, completion):
assert not completion
+
+ @pytest.mark.complete("xrandr -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_xrdb.py b/test/t/test_xrdb.py
index 8f675e68..3ffce2c5 100644
--- a/test/t/test_xrdb.py
+++ b/test/t/test_xrdb.py
@@ -5,3 +5,7 @@ class TestXrdb:
@pytest.mark.complete("xrdb ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("xrdb -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_xsltproc.py b/test/t/test_xsltproc.py
index 26898777..259f9eb9 100644
--- a/test/t/test_xsltproc.py
+++ b/test/t/test_xsltproc.py
@@ -6,6 +6,6 @@ class TestXsltproc:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("xsltproc -")
+ @pytest.mark.complete("xsltproc -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_xvfb_run.py b/test/t/test_xvfb_run.py
new file mode 100644
index 00000000..89eb8308
--- /dev/null
+++ b/test/t/test_xvfb_run.py
@@ -0,0 +1,12 @@
+import pytest
+
+
+@pytest.mark.bashcomp(cmd="xvfb-run")
+class TestXvfbRun:
+ @pytest.mark.complete("xvfb-run ")
+ def test_no_args(self, completion):
+ assert any(x in completion for x in ("bash", "xvfb-run"))
+
+ @pytest.mark.complete("xvfb-run -", require_cmd=True)
+ def test_options(self, completion):
+ assert completion
diff --git a/test/t/test_xxd.py b/test/t/test_xxd.py
index bd461eb7..9e84bb7c 100644
--- a/test/t/test_xxd.py
+++ b/test/t/test_xxd.py
@@ -6,6 +6,6 @@ class TestXxd:
def test_1(self, completion):
assert completion
- @pytest.mark.complete("xxd -")
+ @pytest.mark.complete("xxd -", require_cmd=True)
def test_2(self, completion):
assert completion
diff --git a/test/t/test_xz.py b/test/t/test_xz.py
index 6b92f480..f226d02b 100644
--- a/test/t/test_xz.py
+++ b/test/t/test_xz.py
@@ -20,3 +20,7 @@ class TestXz:
@pytest.mark.complete("xz ~")
def test_4(self, completion):
assert completion
+
+ @pytest.mark.complete("xz -", require_cmd=True)
+ def test_5(self, completion):
+ assert completion
diff --git a/test/t/test_xzdec.py b/test/t/test_xzdec.py
index e57c1b65..a1e9a3ba 100644
--- a/test/t/test_xzdec.py
+++ b/test/t/test_xzdec.py
@@ -5,3 +5,7 @@ class TestXzdec:
@pytest.mark.complete("xzdec ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("xzdec -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/test_ypcat.py b/test/t/test_ypcat.py
index f743c5ad..0fc4b458 100644
--- a/test/t/test_ypcat.py
+++ b/test/t/test_ypcat.py
@@ -2,6 +2,6 @@ import pytest
class TestYpcat:
- @pytest.mark.complete("ypcat ")
+ @pytest.mark.complete("ypcat ", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_ypmatch.py b/test/t/test_ypmatch.py
index db56320a..18331aa7 100644
--- a/test/t/test_ypmatch.py
+++ b/test/t/test_ypmatch.py
@@ -2,6 +2,7 @@ import pytest
class TestYpmatch:
- @pytest.mark.complete("ypmatch foo ")
+ # Actually requires ypcat
+ @pytest.mark.complete("ypmatch foo ", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_yum.py b/test/t/test_yum.py
index 5d4a052b..5dd1ebac 100644
--- a/test/t/test_yum.py
+++ b/test/t/test_yum.py
@@ -2,6 +2,6 @@ import pytest
class TestYum:
- @pytest.mark.complete("yum -")
+ @pytest.mark.complete("yum -", require_cmd=True)
def test_1(self, completion):
assert completion
diff --git a/test/t/test_zopfli.py b/test/t/test_zopfli.py
index 127eda28..e5a71b3c 100644
--- a/test/t/test_zopfli.py
+++ b/test/t/test_zopfli.py
@@ -9,3 +9,7 @@ class TestZopfli:
@pytest.mark.complete("zopfli ~")
def test_2(self, completion):
assert completion
+
+ @pytest.mark.complete("zopfli -", require_cmd=True)
+ def test_3(self, completion):
+ assert completion
diff --git a/test/t/test_zopflipng.py b/test/t/test_zopflipng.py
index a01e7bd7..3ff120ff 100644
--- a/test/t/test_zopflipng.py
+++ b/test/t/test_zopflipng.py
@@ -5,3 +5,7 @@ class TestZopflipng:
@pytest.mark.complete("zopflipng ")
def test_1(self, completion):
assert completion
+
+ @pytest.mark.complete("zopflipng -", require_cmd=True)
+ def test_2(self, completion):
+ assert completion
diff --git a/test/t/unit/Makefile.am b/test/t/unit/Makefile.am
index a0ab7502..b96b326c 100644
--- a/test/t/unit/Makefile.am
+++ b/test/t/unit/Makefile.am
@@ -11,7 +11,9 @@ EXTRA_DIST = \
test_unit_longopt.py \
test_unit_parse_help.py \
test_unit_parse_usage.py \
- test_unit_tilde.py
+ test_unit_quote.py \
+ test_unit_tilde.py \
+ test_unit_variables.py
all:
diff --git a/test/t/unit/test_unit_filedir.py b/test/t/unit/test_unit_filedir.py
index dcd52403..7f14f294 100644
--- a/test/t/unit/test_unit_filedir.py
+++ b/test/t/unit/test_unit_filedir.py
@@ -1,9 +1,125 @@
import pytest
-from conftest import assert_bash_exec
+from conftest import assert_bash_exec, assert_complete
@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=")
class TestUnitFiledir:
+ @pytest.fixture(scope="class")
+ def functions(self, request, bash):
+ assert_bash_exec(
+ bash,
+ "_f() { local cur=$(_get_cword); unset COMPREPLY; _filedir; }; "
+ "complete -F _f f; "
+ "complete -F _f -o filenames f2",
+ )
+ assert_bash_exec(
+ bash,
+ "_g() { local cur=$(_get_cword); unset COMPREPLY; _filedir e1; }; "
+ "complete -F _g g",
+ )
+ assert_bash_exec(
+ bash,
+ "_fd() { local cur=$(_get_cword); unset COMPREPLY; _filedir -d; };"
+ "complete -F _fd fd",
+ )
+
def test_1(self, bash):
assert_bash_exec(bash, "_filedir >/dev/null")
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_2(self, bash, functions, funcname):
+ completion = assert_complete(bash, "%s ab/" % funcname, cwd="_filedir")
+ assert completion == "ab/e"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_3(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r"%s a\ b/" % funcname, cwd="_filedir"
+ )
+ assert completion == "a b/i"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_4(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r"%s a\'b/" % funcname, cwd="_filedir"
+ )
+ assert completion == "a'b/c"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_5(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r"%s a\&b/" % funcname, cwd="_filedir"
+ )
+ assert completion == "a&b/f"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_6(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r"%s a\$" % funcname, cwd="_filedir"
+ )
+ assert completion == "a$b/"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_7(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r"%s 'ab/" % funcname, cwd="_filedir"
+ )
+ assert completion == "ab/e"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_8(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r"%s 'a b/" % funcname, cwd="_filedir"
+ )
+ assert completion == "a b/i"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_9(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r"%s 'a$b/" % funcname, cwd="_filedir"
+ )
+ assert completion == "a$b/h"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_10(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r"%s 'a&b/" % funcname, cwd="_filedir"
+ )
+ assert completion == "a&b/f"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_11(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r'%s "ab/' % funcname, cwd="_filedir"
+ )
+ assert completion == "ab/e"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_12(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, r'%s "a b/' % funcname, cwd="_filedir"
+ )
+ assert completion == "a b/i"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_13(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, "%s \"a'b/" % funcname, cwd="_filedir"
+ )
+ assert completion == "a'b/c"
+
+ @pytest.mark.parametrize("funcname", "f f2".split())
+ def test_14(self, bash, functions, funcname):
+ completion = assert_complete(
+ bash, '%s "a&b/' % funcname, cwd="_filedir"
+ )
+ assert completion == "a&b/f"
+
+ @pytest.mark.complete(r"fd a\ ", cwd="_filedir")
+ def test_15(self, functions, completion):
+ assert completion == "a b/"
+
+ @pytest.mark.complete("g ", cwd="_filedir/ext")
+ def test_16(self, functions, completion):
+ assert completion == sorted("ee.e1 foo/ gg.e1 ii.E1".split())
diff --git a/test/t/unit/test_unit_ip_addresses.py b/test/t/unit/test_unit_ip_addresses.py
index cd7a38ab..8120c882 100644
--- a/test/t/unit/test_unit_ip_addresses.py
+++ b/test/t/unit/test_unit_ip_addresses.py
@@ -1,6 +1,6 @@
import pytest
-from conftest import assert_bash_exec, in_docker
+from conftest import assert_bash_exec, in_container
@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=")
@@ -41,7 +41,7 @@ class TestUnitIpAddresses:
assert completion
assert all("." in x for x in completion)
- @pytest.mark.xfail(in_docker(), reason="Probably fails in docker")
+ @pytest.mark.xfail(in_container(), reason="Probably fails in a container")
@pytest.mark.complete("ia6 ")
def test_4(self, functions, completion):
"""_ip_addresses -6 should complete ipv6 addresses."""
diff --git a/test/t/unit/test_unit_quote.py b/test/t/unit/test_unit_quote.py
new file mode 100644
index 00000000..e9f81c2d
--- /dev/null
+++ b/test/t/unit/test_unit_quote.py
@@ -0,0 +1,36 @@
+import pytest
+
+from conftest import assert_bash_exec, TestUnitBase
+
+
+@pytest.mark.bashcomp(cmd=None)
+class TestUnitQuote(TestUnitBase):
+ def test_1(self, bash):
+ output = assert_bash_exec(
+ bash, 'quote "a b"', want_output=True, want_newline=False
+ )
+ assert output.strip() == "'a b'"
+
+ def test_2(self, bash):
+ output = assert_bash_exec(
+ bash, 'quote "a b"', want_output=True, want_newline=False
+ )
+ assert output.strip() == "'a b'"
+
+ def test_3(self, bash):
+ output = assert_bash_exec(
+ bash, 'quote " a "', want_output=True, want_newline=False
+ )
+ assert output.strip() == "' a '"
+
+ def test_4(self, bash):
+ output = assert_bash_exec(
+ bash, "quote \"a'b'c\"", want_output=True, want_newline=False
+ )
+ assert output.strip() == r"'a'\''b'\''c'"
+
+ def test_5(self, bash):
+ output = assert_bash_exec(
+ bash, 'quote "a\'"', want_output=True, want_newline=False
+ )
+ assert output.strip() == r"'a'\'''"
diff --git a/test/t/unit/test_unit_variables.py b/test/t/unit/test_unit_variables.py
new file mode 100644
index 00000000..dd7a4219
--- /dev/null
+++ b/test/t/unit/test_unit_variables.py
@@ -0,0 +1,41 @@
+import pytest
+
+from conftest import assert_bash_exec
+
+
+@pytest.mark.bashcomp(cmd=None, ignore_env=r"^[+-](___var|assoc[12])=")
+class TestUnitVariables:
+ @pytest.fixture(scope="class")
+ def functions(self, request, bash):
+ assert_bash_exec(bash, "unset assoc1 && declare -A assoc1=([idx]=1)")
+ assert_bash_exec(
+ bash, "unset assoc2 && declare -A assoc2=([idx1]=1 [idx2]=2)"
+ )
+ assert_bash_exec(bash, "unset ${!___v*} && declare ___var=''")
+ request.addfinalizer(
+ lambda: assert_bash_exec(bash, "unset ___var assoc1 assoc2")
+ )
+
+ @pytest.mark.complete(": $___v")
+ def test_simple_variable_name(self, functions, completion):
+ assert completion == "$___var".split()
+
+ @pytest.mark.complete(": ${assoc1[")
+ def test_single_array_index(self, functions, completion):
+ assert completion == "${assoc1[idx]}".split()
+
+ @pytest.mark.complete(": ${assoc2[")
+ def test_multiple_array_indexes(self, functions, completion):
+ assert completion == "${assoc2[idx1]} ${assoc2[idx2]}".split()
+
+ @pytest.mark.complete(": ${assoc1[bogus]")
+ def test_closing_curly_after_square(self, functions, completion):
+ assert completion == "${assoc1[bogus]}".split()
+
+ @pytest.mark.complete(": ${assoc1[@")
+ def test_closing_brackets_after_at(self, functions, completion):
+ assert completion == "${assoc1[@]}".split()
+
+ @pytest.mark.complete(": ${#___v")
+ def test_hash_prefix(self, functions, completion):
+ assert completion == "${#___var}".split()
diff --git a/test/unit/_filedir.exp b/test/unit/_filedir.exp
index 7395bf9a..1de49504 100644
--- a/test/unit/_filedir.exp
+++ b/test/unit/_filedir.exp
@@ -1,6 +1,6 @@
proc setup {} {
assert_bash_exec {unset COMPREPLY cur}
- assert_bash_exec {unset -f _f _fd}
+ assert_bash_exec {unset -f _f}
save_env
# Declare bash completion function `_f'
assert_bash_exec { \
@@ -11,16 +11,6 @@ proc setup {} {
assert_bash_exec { \
complete -F _f -o filenames f2 \
}
- # Declare bash completion function `_g' to complete on `.e1' files
- assert_bash_exec { \
- _g() { local cur=$(_get_cword); unset COMPREPLY; _filedir e1; }; \
- complete -F _g g \
- }
- # Declare bash completion function `_fd' to complete on dirs
- assert_bash_exec { \
- _fd() { local cur=$(_get_cword); unset COMPREPLY; _filedir -d; }; \
- complete -F _fd fd \
- }
# Create directories `a"b', `a*b', and `a\b' only when not running on
# Cygwin/Windows (`"', `*', or `\' aren't allowed in filenames there)
if {! [is_cygwin]} {
@@ -41,8 +31,8 @@ proc teardown {} {
assert_bash_exec {(cd $TESTDIR/tmp && rm -- a\*b/j && rmdir a\*b/ || true)}
}
assert_bash_exec {unset COMPREPLY cur}
- assert_bash_exec {unset -f _f _g _fd}
- assert_bash_exec {complete -r f g fd}
+ assert_bash_exec {unset -f _f}
+ assert_bash_exec {complete -r f}
assert_env_unmodified {
/OLDPWD/d
/OLD_CTYPE/d
@@ -55,21 +45,6 @@ setup
foreach name {f f2} {
- set test "completing $name ab/ should return e"
- set cmd "$name ab/"
- assert_complete_dir e $cmd "$::srcdir/fixtures/_filedir" $test
- sync_after_int
-
- set test "completing $name a\\ b/ should return i"
- set cmd "$name a\\ b/"
- assert_complete_dir i $cmd "$::srcdir/fixtures/_filedir" $test
- sync_after_int
-
- set test "completing $name a\\\'b/ should return c"
- set cmd "$name a\\\'b/"
- assert_complete_dir c $cmd "$::srcdir/fixtures/_filedir" $test
- sync_after_int
-
set test "completing $name a\\\$b/ should return h"
if {[info exists ::env(CI)] && [info exists ::env(DIST)] && $::env(DIST) == "centos6"} {
xfail $test
@@ -91,28 +66,6 @@ foreach name {f f2} {
sync_after_int
}
- set test "completing $name a\\&b/ should return f"
- set cmd "$name a\\&b/"
- assert_complete_dir f $cmd "$::srcdir/fixtures/_filedir" $test
- sync_after_int
-
- set test "completing $name a\$ should return a\\\$b/"
- set cmd "$name a\$"
- assert_complete_dir "\b\\\\\$b/" $cmd "$::srcdir/fixtures/_filedir" $test -nospace
- sync_after_int
-
- set cmd "$name 'ab/"
- assert_complete_dir {e'} $cmd "$::srcdir/fixtures/_filedir"
- sync_after_int
-
- set cmd "$name 'a b/"
- assert_complete_dir {i'} $cmd "$::srcdir/fixtures/_filedir"
- sync_after_int
-
- set cmd "$name 'a\$b/"
- assert_complete_dir {h'} $cmd "$::srcdir/fixtures/_filedir"
- sync_after_int
-
if {! [is_cygwin]} { # Illegal characters in file/dir names
set cmd "$name 'a\"b/"; #"
assert_complete_dir {d'} $cmd "$TESTDIR/tmp"
@@ -123,22 +76,6 @@ foreach name {f f2} {
sync_after_int
}
- set cmd "$name 'a&b/"
- assert_complete_dir {f'} $cmd "$::srcdir/fixtures/_filedir"
- sync_after_int
-
- set cmd "$name \"ab/"; #"
- assert_complete_dir {e"} $cmd "$::srcdir/fixtures/_filedir"; #"
- sync_after_int
-
- set cmd "$name \"a b/"; #"
- assert_complete_dir {i"} $cmd "$::srcdir/fixtures/_filedir"; #"
- sync_after_int
-
- set cmd "$name \"a'b/"; #"
- assert_complete_dir {c"} $cmd "$::srcdir/fixtures/_filedir"; #"
- sync_after_int
-
if {! [is_cygwin]} { # Illegal characters in file/dir names
set cmd "$name \"a\\\"b/"; #"
assert_complete_dir {d"} $cmd "$TESTDIR/tmp"; #"
@@ -161,20 +98,12 @@ foreach name {f f2} {
assert_complete_dir {g"} $cmd "$TESTDIR/tmp"; #"
sync_after_int
- set cmd "$name \"a&b/"; #"
- assert_complete_dir {f"} $cmd "$::srcdir/fixtures/_filedir"; #"
- sync_after_int
-
set cmd "$name \\\[x"
assert_complete_dir {\[x\]} $cmd "$::srcdir/fixtures/_filedir/brackets"
sync_after_int
}; # foreach
-set test "completing with filter '.e1' should show completions"
-assert_complete_dir {ee.e1 foo/ gg.e1 ii.E1} "g " "$::srcdir/fixtures/_filedir/ext" $test
-sync_after_int
-
set test "completing f aƩ should return g"
# Execute this test only with LC_CTYPE matching *UTF-8*
# See also: http://www.mail-archive.com/bash-completion-devel\
@@ -191,10 +120,5 @@ if {
}
sync_after_int
-set test "completing fd a\\ should return a\\ b/"
-set cmd "fd a\\ "
-assert_complete_dir "a\\ b/" $cmd "$::srcdir/fixtures/_filedir" $test -nospace
-sync_after_int
-
teardown
diff --git a/test/unit/_variables.exp b/test/unit/_variables.exp
deleted file mode 100644
index 31411d53..00000000
--- a/test/unit/_variables.exp
+++ /dev/null
@@ -1,39 +0,0 @@
-proc setup {} {
- assert_bash_exec { unset assoc1 && declare -A assoc1=([idx]=1)}
- assert_bash_exec { unset assoc2 && declare -A assoc2=([idx1]=1 [idx2]=2)}
- assert_bash_exec { unset ${!___v*} && declare ___var='' }
- save_env
-}
-
-
-proc teardown {} {
- assert_bash_exec {unset assoc1 assoc2}
-}
-
-
-setup
-
-set test "Complete simple variable names"
-assert_complete "\$___var" ": \$___v" $test
-
-set test "Complete single array index"
-assert_complete "\$\{assoc1\[idx\]\}" ": \$\{assoc1\[" $test
-sync_after_int
-
-set test "Complete closing curly bracket after square bracket"
-assert_complete "\$\{assoc1\[bogus\]\}" ": \$\{assoc1\[bogus\]" $test
-sync_after_int
-
-set test "Complete closing brackets after @ index"
-assert_complete "\$\{assoc1\[@\]\}" ": \$\{assoc1\[@" $test
-sync_after_int
-
-# For some reason -expect-cmd-minus is necessary here
-set test "Complete multiple array indexes"
-assert_complete_partial { \$\{assoc2\[idx1\]\} \$\{assoc2\[idx2\]\} } ":" "\$\{assoc2\[" $test -expect-cmd-minus "\${assoc2\["
-sync_after_int
-
-set test "Complete variables prefixed with #"
-assert_complete "\$\{#___var\}" ": \$\{#___v" $test
-
-teardown
diff --git a/test/unit/compgen.exp b/test/unit/compgen.exp
deleted file mode 100644
index 9fc1efba..00000000
--- a/test/unit/compgen.exp
+++ /dev/null
@@ -1,35 +0,0 @@
-proc setup {} {
- save_env
-}
-
-
-proc teardown {} {
- assert_env_unmodified {/OLDPWD/d}
-}
-
-
-setup
-
-
-set test {compgen -f a\\\'b/ should return a\'b/c}
-set cmd {compgen -f a\\\'b/}
-set dir $::srcdir/fixtures/compgen
-assert_bash_exec "cd $dir"
-send "$cmd\r"
-expect -ex "$cmd\r\n"
-expect {
- -re {a\\\'b/c} { pass $test }
- -re {a'b/c} { fail $test }
- -re /@ { pass "$test" }
- -re eof { unresolved "eof" }
-}
-sync_after_int
-assert_bash_exec {cd "$TESTDIR"}
-
-#assert_bash_list_dir {a\\\'b/c} $cmd $::srcdir/fixtures/compgen
-
-
-sync_after_int
-
-
-teardown
diff --git a/test/unit/quote.exp b/test/unit/quote.exp
deleted file mode 100644
index 1764e6b0..00000000
--- a/test/unit/quote.exp
+++ /dev/null
@@ -1,65 +0,0 @@
-proc setup {} {
- save_env
-}
-
-
-proc teardown {} {
- assert_env_unmodified
-}
-
-
-setup
-
-
-set cmd {quote "a b"}
-set test {quote "a b" should output 'a b'}
-send "$cmd\r"
-expect -ex "$cmd\r\n"
-expect {
- -re {'a b'} { pass $test }
- default { fail $test }
-}
-sync_after_int
-
-set cmd {quote "a b"}
-set test {quote "a b" should output 'a b'}
-send "$cmd\r"
-expect -ex "$cmd\r\n"
-expect {
- -re {'a b'} { pass $test }
- default { fail $test }
-}
-sync_after_int
-
-set cmd {quote " a "}
-set test {quote " a " should output ' a '}
-send "$cmd\r"
-expect -ex "$cmd\r\n"
-expect {
- -re {' a '} { pass $test }
- default { fail $test }
-}
-sync_after_int
-
-set cmd {quote "a'b'c"}
-set test {quote "a'b'c" should output 'a'\''b'\''c'}
-send "$cmd\r"
-expect -ex "$cmd\r\n"
-expect {
- -re {'a'\\''b'\\''c'} { pass $test }
- default { fail $test }
-}
-sync_after_int
-
-set cmd {quote "a'"}
-set test {quote "a'" should output 'a'\'''}
-send "$cmd\r"
-expect -ex "$cmd\r\n"
-expect {
- -re {'a'\\'''} { pass $test }
- default { fail $test }
-}
-sync_after_int
-
-
-teardown