Skip to content

Commit c18756c

Browse files
committed
fix(ulimit): do not offer soft/hard/unlimited directly after -S or -H
1 parent c12e4da commit c18756c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

completions/ulimit

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ _ulimit()
3232
fi
3333
fi
3434

35+
[[ $prev == -[SH] ]] && return
36+
3537
local args
3638
_count_args
3739
((args == 1)) &&

test/t/test_ulimit.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import pytest
22

3+
from conftest import assert_complete
4+
35

46
class TestUlimit:
57
@pytest.mark.complete("ulimit ")
@@ -33,3 +35,8 @@ def test_6(self, completion):
3335
def test_7(self, completion):
3436
"""Test modes are NOT completed with -a given somewhere."""
3537
assert not completion
38+
39+
@pytest.mark.parametrize("flag", ["-S", "-H"])
40+
def test_no_special_values_after_soft_or_hard(self, bash, flag):
41+
completion = assert_complete(bash, "ulimit %s " % flag)
42+
assert not completion

0 commit comments

Comments
 (0)