-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,6 +189,7 @@ bashcomp_DATA = 2to3 \ | |
jps \ | ||
jshint \ | ||
json_xs \ | ||
jsonschema \ | ||
k3b \ | ||
kcov \ | ||
kill \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# bash completion for jsonschema -*- shell-script -*- | ||
|
||
_jsonschema() | ||
{ | ||
local cur prev words cword | ||
_init_completion || return | ||
|
||
case $prev in | ||
--help|--error-format|--validator|-[hFV]) | ||
return | ||
;; | ||
--instance|-i) | ||
_filedir json | ||
return | ||
;; | ||
esac | ||
|
||
if [[ "$cur" == -* ]]; then | ||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) | ||
return | ||
fi | ||
|
||
local args; _count_args "" "-*" | ||
[[ $args -eq 1 ]] || return | ||
_filedir '@(json|schema)' | ||
} && | ||
complete -F _jsonschema jsonschema | ||
|
||
# ex: filetype=sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pytest | ||
|
||
|
||
class TestJsonschema: | ||
|
||
@pytest.mark.complete("jsonschema ") | ||
def test_1(self, completion): | ||
assert completion | ||
|
||
@pytest.mark.complete("jsonschema -") | ||
def test_2(self, completion): | ||
assert completion |