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
4aedc291
Commit
4aedc291
authored
Jun 09, 2014
by
Roman Inflianskas
Committed by
Bruno Pinto
Nov 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dpaste] Underscoring all private variables and functions
parent
9ce45f5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
plugins/dpaste/dpaste.fish
plugins/dpaste/dpaste.fish
+22
-22
No files found.
plugins/dpaste/dpaste.fish
View file @
4aedc291
...
...
@@ -6,9 +6,9 @@
# Based on oh-my-zsh's sprunge plugin
set dpaste_expires_choises '(onetime|never|hour|week|month)'
set
__
dpaste_expires_choises '(onetime|never|hour|week|month)'
function dpaste_set_defaults
function
__
dpaste_set_defaults
if [ -z $dpaste_keyword ]
set -g dpaste_keyword content
end
...
...
@@ -17,57 +17,57 @@ function dpaste_set_defaults
end
end
function dpaste_send
function
__
dpaste_send
# echo $dpaste_url >&2
# echo $dpaste_send_url >&2
curl -F "$dpaste_keyword=<-" $dpaste_send_url
# echo $
__
dpaste_send_url >&2
curl -F "$dpaste_keyword=<-" $
__
dpaste_send_url
end
function dpaste_parse_expires
set expires_spec "-t $dpaste_expires_choises"
set
dpaste_
expires (echo $argv | sed -r "s/.*$expires_spec.*/\1/" | sed 's/hour/3600/' | sed 's/week/604800/' | sed 's/month/2592000/')
if [ -z (echo $
dpaste_expires | sed -r "s/$
dpaste_expires_choises//") ]
set
dpaste_send_url "$dpaste_send_url&expires=$dpaste_
expires"
function
__
dpaste_parse_expires
set expires_spec "-t $
__
dpaste_expires_choises"
set expires (echo $argv | sed -r "s/.*$expires_spec.*/\1/" | sed 's/hour/3600/' | sed 's/week/604800/' | sed 's/month/2592000/')
if [ -z (echo $
expires | sed -r "s/$__
dpaste_expires_choises//") ]
set
__dpaste_send_url "$__dpaste_send_url&expires=$
expires"
end
echo $argv | sed -r "s/$expires_spec//"
end
function dpaste_help
function
__
dpaste_help
echo -e \
"Usage:
dpaste [-t EXPIRES] < README.md
dpaste [-t EXPIRES] README.md
cat README.md | dpaste [-t EXPIRES]
dpaste [-t EXPIRES]
"I \<3 to paste
"
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]"
end
function dpaste_parse_help
function
__
dpaste_parse_help
if contains -- -h $argv
dpaste_help
__
dpaste_help
end
end
function dpaste
dpaste_set_defaults
set -g dpaste_send_url $dpaste_url
dpaste_parse_help $argv
__
dpaste_set_defaults
set -g
__
dpaste_send_url $dpaste_url
__
dpaste_parse_help $argv
or begin
set argv (dpaste_parse_expires $argv)
set argv (
__
dpaste_parse_expires $argv)
if isatty
if [ -n $argv ]
if [ -f $argv ]
cat $argv
else
echo $argv
end | dpaste_send
end |
__
dpaste_send
else
dpaste_help
__
dpaste_help
end
else
dpaste_send
__
dpaste_send
end
end
end
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