From 09541e952446e65db001de7534a49b852193b53f Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Mon, 30 Jul 2018 14:38:00 -0500 Subject: [PATCH] Add completions for `hjson` --- CHANGELOG.md | 1 + share/completions/hjson.fish | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 share/completions/hjson.fish diff --git a/CHANGELOG.md b/CHANGELOG.md index 05f89546d..4989f8d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ fish 3.0 is a major release which brings with it both improvements in functional - `bd` (#4472) - `bower` - `configure` (autoconf only) + - `hjson` - `j` (autojump #4344) - `jhipster` (#4472) - `kldload` diff --git a/share/completions/hjson.fish b/share/completions/hjson.fish new file mode 100644 index 000000000..8cd433fb7 --- /dev/null +++ b/share/completions/hjson.fish @@ -0,0 +1,14 @@ +complete -c hjson -n '__fish_should_complete_switches' -s j -l json -d "output formatted json" +complete -c hjson -n '__fish_should_complete_switches' -s c -l compact -d "output condensed json" + +# these are "old-style" arguments so using `__fish_should_complete_switches` is needed +# to prevent completing them by default as regular arguments. +complete -c hjson -n '__fish_should_complete_switches' -a "-sl" -d "output the opening brace on the same line" +complete -c hjson -n '__fish_should_complete_switches' -a "-quote" -d "quote all strings" +complete -c hjson -n '__fish_should_complete_switches' -a "-quote=all" -d "quote all strings and keys" +complete -c hjson -n '__fish_should_complete_switches' -a "-js" -d "output in JSON-compatible format" +complete -c hjson -n '__fish_should_complete_switches' -a "-rt" -d "round trip comments" +complete -c hjson -n '__fish_should_complete_switches' -a "-nocol" -d "disable color output" +complete -c hjson -n '__fish_should_complete_switches' -a "-cond=" -d "set condense option [default 60]" + +complete -c hjson -k -xa "(__fish_complete_suffix '.{hjson,json}')"