Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions completions/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ cross_platform = 2to3 \
_flamegraph \
fprintd-delete \
fprintd-enroll \
free \
freeciv \
freeciv-server \
function \
Expand Down
21 changes: 21 additions & 0 deletions completions/free
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# bash completion for free(1) -*- shell-script -*-

_comp_cmd_free()
{
local cur prev words cword comp_args
_comp_initialize -- "$@" || return

local noargopts='!(-*|*[cs]*)'
case $prev in
--help | --version | --count | --seconds | -${noargopts}[hVcs])
return
;;
esac

if [[ $cur == -* ]]; then
_comp_compgen_help || _comp_compgen_usage
fi
} &&
complete -F _comp_cmd_free free

# ex: filetype=sh
1 change: 1 addition & 0 deletions test/t/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ EXTRA_DIST = \
test_fprintd_enroll.py \
test_fprintd_list.py \
test_fprintd_verify.py \
test_free.py \
test_freebsd_update.py \
test_freeciv.py \
test_freeciv_server.py \
Expand Down
11 changes: 11 additions & 0 deletions test/t/test_free.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest


class TestFree:
@pytest.mark.complete("free ")
def test_basic(self, completion):
assert not completion

@pytest.mark.complete("free -", require_cmd=True)
def test_options(self, completion):
assert completion
1 change: 1 addition & 0 deletions test/test-cmd-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ fmt
fold
fprintd-enroll
fprintd-verify
free
freeciv
freeciv-server
fusermount
Expand Down