mirror of
https://github.com/seejohnrun/haste-client.git
synced 2025-12-15 16:25:57 +00:00
@@ -39,6 +39,15 @@ cat file | haste
|
|||||||
haste file
|
haste file
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## You can get the raw version
|
||||||
|
|
||||||
|
Want the raw URL returned instead? (a plain-text version)?
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
cat file | haste --raw # or
|
||||||
|
haste file --raw
|
||||||
|
```
|
||||||
|
|
||||||
## Changing the location of your haste server
|
## Changing the location of your haste server
|
||||||
|
|
||||||
By default, haste will point at `http://hastebin.com`. You can change this by setting the value of `ENV['HASTE_SERVER']` to the URL of your haste server. You can also use `alias` to make easy shortcuts if you commonly use a few hastes intermingled with each other. To do that, you'd put something like this into ~.bash_profile:
|
By default, haste will point at `http://hastebin.com`. You can change this by setting the value of `ENV['HASTE_SERVER']` to the URL of your haste server. You can also use `alias` to make easy shortcuts if you commonly use a few hastes intermingled with each other. To do that, you'd put something like this into ~.bash_profile:
|
||||||
|
|||||||
@@ -10,13 +10,18 @@ module Haste
|
|||||||
# And then handle the basic usage
|
# And then handle the basic usage
|
||||||
def start
|
def start
|
||||||
# Take data in
|
# Take data in
|
||||||
key = if STDIN.tty?
|
if STDIN.tty?
|
||||||
@uploader.upload_path ARGV.first
|
key = @uploader.upload_path ARGV.first
|
||||||
else
|
else
|
||||||
@uploader.upload_raw STDIN.readlines.join
|
key = @uploader.upload_raw STDIN.readlines.join
|
||||||
|
end
|
||||||
|
# Put together a URL
|
||||||
|
if ARGV.include?('--raw')
|
||||||
|
url = "#{@uploader.server_url}/raw/#{key}"
|
||||||
|
else
|
||||||
|
url = "#{@uploader.server_url}/#{key}"
|
||||||
end
|
end
|
||||||
# And write data out
|
# And write data out
|
||||||
url = "#{@uploader.server_url}/#{key}"
|
|
||||||
if STDOUT.tty?
|
if STDOUT.tty?
|
||||||
STDOUT.puts url
|
STDOUT.puts url
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user