flip writing made easier
This commit is contained in:
@@ -13,8 +13,8 @@ _help() {
|
||||
(w)rite Save to clipboard, read from stdin/file/folder
|
||||
(d)elete Delete an entry
|
||||
url Get the direct share url
|
||||
upload Get URL for uploads
|
||||
update Update flip client
|
||||
upload Get URL for uploads [no arguments]
|
||||
update Update flip client [no arguments]
|
||||
|
||||
Name: Any string for the clipboard name. default: 0
|
||||
|
||||
@@ -27,6 +27,7 @@ _help() {
|
||||
Shorthand:
|
||||
echo my data | $SELF 1 # writes data with name: 1
|
||||
$SELF 1 | cat - # prints the contents of file: 1
|
||||
$SELF w file.ext # sends file keeping its name
|
||||
|
||||
Config:
|
||||
set: FLEES_ROOTURL, FLEES_SHARE, FLEES_TOKEN
|
||||
@@ -57,8 +58,14 @@ _list() {
|
||||
}
|
||||
|
||||
_write() {
|
||||
# no file mentioned, use stdin
|
||||
[[ -z "$FILE" ]] && stream_in=1
|
||||
# no file mentioned, use the name as file
|
||||
[[ -z "$FILE" ]] && {
|
||||
[[ -e "$NAME" ]] && {
|
||||
# NAME is actually the file, reverse roles
|
||||
FILE="$NAME"
|
||||
NAME=$( basename "$NAME" )
|
||||
}
|
||||
}
|
||||
# stdin is open, use stdin
|
||||
[ -t 0 ] || stream_in=1
|
||||
|
||||
@@ -192,4 +199,3 @@ _get_file
|
||||
_url "$NAME"
|
||||
exit $?
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user