Skip to content

Commit 521348d

Browse files
scopakinomyoga
andauthored
feat(ssh-keygen): sync -O options with openssh 8.4p1, FIDO arg fixes (scop#674)
The man page is missing bunch of equal signs for FIDO options that take an argument. Co-authored-by: Koichi Murase <[email protected]>
1 parent 4298bc2 commit 521348d

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

completions/ssh-keygen

+11-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ _ssh_keygen()
6666
no-x11-forwarding permit-agent-forwarding
6767
permit-port-forwarding permit-pty permit-user-rc
6868
permit-X11-forwarding no-touch-required source-address=
69+
verify-required
6970
7071
lines= start-line= checkpoint= memory= start= generator=
7172
72-
application challenge= device resident user
73-
write-attestation-path
73+
application= challenge= device= no-touch-required resident
74+
user= write-attestation=
7475
' -- "$cur"))
7576
[[ ${COMPREPLY-} == *[:=] ]] && compopt -o nospace
7677
__ltrim_colon_completions "$cur"
@@ -80,10 +81,17 @@ _ssh_keygen()
8081
compopt -o filenames
8182
COMPREPLY=($(compgen -c -- "${cur#*=}"))
8283
;;
83-
checkpoint=* | challenge=*)
84+
checkpoint=* | challenge=* | write-attestation=*)
8485
cur=${cur#*=}
8586
_filedir
8687
;;
88+
application=*([^:=]))
89+
COMPREPLY=($(compgen -W "ssh:" -- "${cur#*=}"))
90+
compopt -o nospace
91+
;;
92+
user=*)
93+
COMPREPLY=($(compgen -u -- "${cur#*=}"))
94+
;;
8795
esac
8896
fi
8997
return

test/t/test_ssh_keygen.py

+16
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,19 @@ def test_O_force_command(self, completion):
6969
@pytest.mark.complete("ssh-keygen -O unknown=")
7070
def test_O_unknown(self, completion):
7171
assert not completion
72+
73+
@pytest.mark.complete("ssh-keygen -O application=")
74+
def test_O_application(self, completion):
75+
assert completion == "ssh:"
76+
77+
@pytest.mark.complete("ssh-keygen -O application=s")
78+
def test_O_application_s(self, completion):
79+
assert completion == "sh:"
80+
81+
@pytest.mark.complete("ssh-keygen -O application=ssh:")
82+
def test_O_application_ssh_colon(self, completion):
83+
assert not completion
84+
85+
@pytest.mark.complete("ssh-keygen -O application=nonexistent")
86+
def test_O_application_nonexistent(self, completion):
87+
assert not completion

0 commit comments

Comments
 (0)