diff --git a/roles/fish/files/fish/cli/functions/test.fish b/roles/fish/files/fish/cli/functions/test.fish new file mode 100755 index 0000000..4db6d5e --- /dev/null +++ b/roles/fish/files/fish/cli/functions/test.fish @@ -0,0 +1,17 @@ +#!/usr/bin/fish + +# base : https://github.com/fish-shell/fish-shell/issues/939#issuecomment-22058614 + +# upload image : up file.png +# upload piped data : cat file.txt | up +# upload clipboard : up +# validation : if filetype is txt then open vim to valid or edit +# catch url : middle clic to paste url + +# If filename as argument +if isatty stdin + cat $argv +# Else piping data +else + cat - +end diff --git a/roles/fish/files/fish/cli/functions/up.fish b/roles/fish/files/fish/cli/functions/up.fish new file mode 100644 index 0000000..de25c24 --- /dev/null +++ b/roles/fish/files/fish/cli/functions/up.fish @@ -0,0 +1,3 @@ +function up + ~/bin/up $argv; +end