fish: add license function
This commit is contained in:
parent
e15b928489
commit
109c5787f1
13
fish/completions/license.fish
Normal file
13
fish/completions/license.fish
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
complete -c license -f -n "__fish_use_subcommand" -a "agpl-3.0\t'GNU Affero General Public License v3.0'
|
||||||
|
apache-2.0\t'Apache License 2.0'
|
||||||
|
bsd-2-clause\t'BSD 2-Clause \"Simplified\" License'
|
||||||
|
bsd-3-clause\t'BSD 3-Clause \"New\" or \"Revised\" License'
|
||||||
|
bsl-1.0\t'Boost Software License 1.0'
|
||||||
|
cc0-1.0\t'Creative Commons Zero v1.0 Universal'
|
||||||
|
epl-2.0\t'Eclipse Public License 2.0'
|
||||||
|
gpl-2.0\t'GNU General Public License v2.0'
|
||||||
|
gpl-3.0\t'GNU General Public License v3.0'
|
||||||
|
lgpl-2.1\t'GNU Lesser General Public License v2.1'
|
||||||
|
mit\t'MIT License'
|
||||||
|
mpl-2.0\t'Mozilla Public License 2.0'
|
||||||
|
unlicense\t'The Unlicense'"
|
@ -1,7 +1,5 @@
|
|||||||
jorgebucaran/fisher
|
jorgebucaran/fisher
|
||||||
oh-my-fish/plugin-foreign-env
|
jorgebucaran/replay.fish
|
||||||
oh-my-fish/plugin-license
|
|
||||||
oh-my-fish/plugin-sublime
|
|
||||||
oakninja/MakeMeFish
|
oakninja/MakeMeFish
|
||||||
laughedelic/fish_logo
|
laughedelic/fish_logo
|
||||||
jethrokuan/z
|
jethrokuan/z
|
||||||
|
15
fish/functions/license.fish
Normal file
15
fish/functions/license.fish
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function license
|
||||||
|
set -l base_url https://api.github.com/licenses
|
||||||
|
set -l headers 'Accept: application/vnd.github.v3+json'
|
||||||
|
|
||||||
|
if test $argv[1]
|
||||||
|
set -l license $argv[1]
|
||||||
|
set -l res (curl --silent --header $headers $base_url/$license | jq -r '.body' | string collect)
|
||||||
|
echo $res
|
||||||
|
else
|
||||||
|
set -l res (curl --silent --header $headers $base_url | jq -r '.[].key' | string collect)
|
||||||
|
echo "Available Licenses: "
|
||||||
|
echo
|
||||||
|
echo $res
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user