Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
2d363c74
Commit
2d363c74
authored
Nov 26, 2014
by
Roman Inflianskas
Committed by
Bruno Pinto
Nov 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dpaste] Make dpaste a replacement for sprunge
parent
bb1d149e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
plugins/dpaste/dpaste.fish
plugins/dpaste/dpaste.fish
+25
-5
plugins/dpaste/tests/test_dpaste.fish
plugins/dpaste/tests/test_dpaste.fish
+1
-1
plugins/sprunge/sprunge.fish
plugins/sprunge/sprunge.fish
+1
-0
No files found.
plugins/dpaste/dpaste.fish
View file @
2d363c74
...
...
@@ -14,9 +14,18 @@ set __dpaste_expires_choises '(onetime|1|twotimes|2|hour|week|month|never)'
function __dpaste_set_defaults
set -g __dpaste_url_dpaste_de 'https://dpaste.de/api/?format=url'
set -q dpaste_keyword; or set -g dpaste_keyword 'content'
set -q dpaste_url; or set -g dpaste_url $__dpaste_url_dpaste_de
set -g __dpaste_send_url $dpaste_url
set -g __dpaste_keyword_dpaste_de 'content'
set -g __dpaste_url_sprunge_us 'http://sprunge.us/'
set -g __dpaste_keyword_sprunge_us 'sprunge'
set -q dpaste_site; or set -g dpaste_site 'dpaste.de'
set suffix (echo $dpaste_site | sed "s/\./_/g")
set -g __dpaste_keyword (eval 'echo $__dpaste_keyword_'$suffix)
set -q __dpaste_keyword; or set -g __dpaste_keyword $__dpaste_keyword_dpaste_de
set -g __dpaste_send_url (eval 'echo $__dpaste_url_'$suffix)
set -q __dpaste_send_url; or set -g __dpaste_send_url $__dpaste_url_dpaste_de
set -g __dpaste_eat_once 0
end
function __dpaste_send
...
...
@@ -24,7 +33,7 @@ function __dpaste_send
command curl --silent $argv
end
curl -F "$dpaste_keyword=<-" $__dpaste_send_url | read -l url
curl -F "$
__
dpaste_keyword=<-" $__dpaste_send_url | read -l url
if [ $__dpaste_eat_once = 1 ]
curl $url >/dev/null
end
...
...
@@ -51,7 +60,18 @@ function __dpaste_help
dpaste [-t EXPIRES] \"I \<3 to paste\"
Options:
-t EXPIRES set snippet expiration time: $__dpaste_expires_choises [default: month]"
-t EXPIRES set snippet expiration time: $__dpaste_expires_choises [default: month]
Configuration:
You can use this plugin with other dpaste instances.
If you have a dpaste instance on 'example.com' just insert those lines
into your config.fish file:
set __dpaste_url_example_com 'https://example.com/api/?format=url'
set dpaste_site 'example.com'
You can even use this plugin with sprunge.us.
Note, that sprunge.us doesn't support '-t' option.
set dpaste_site 'sprunge.us'"
end
function __dpaste_parse_help
...
...
plugins/dpaste/tests/test_dpaste.fish
View file @
2d363c74
...
...
@@ -43,8 +43,8 @@ end
function suite_dpaste
function setup
set dpaste_site 'dpaste.de'
__dpaste_set_defaults
set -g __dpaste_send_url $__dpaste_url_dpaste_de
end
function test_dpaste_parse_expires
...
...
plugins/sprunge/sprunge.fish
View file @
2d363c74
...
...
@@ -4,6 +4,7 @@
# Based on oh-my-zsh's sprunge plugin
function sprunge
echo -e 'This plugin is obsolete.\nConsider using dpaste, it is tested, has more features, and supports different sites, including sprunge.\nFor more information, enable dpaste plugin and execute it:\n$ dpaste\n' >&2
if isatty
if [ (count $argv) -gt 0 ]
if [ -f $argv ]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment