Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
5e8960d376 | |||
eece601793 |
16
README.md
16
README.md
@@ -20,4 +20,18 @@ sup
|
|||||||
---
|
---
|
||||||
A very simple tool to upload files to the zfh.so file hosting
|
A very simple tool to upload files to the zfh.so file hosting
|
||||||
|
|
||||||
Usage: sup [-RsF] [-D num] [file/url]
|
Usage: sup [-RsF] [-D num] [file/url]"
|
||||||
|
Flags:
|
||||||
|
-R # Remove the file after uploading.
|
||||||
|
-s # Make a screenshot and upload it instead of a file.
|
||||||
|
-F # Make a fullscreen shot instead of prompting for a window/area. Implies -s.
|
||||||
|
-D <num> # Delay the shot by <num> seconds.
|
||||||
|
-p # Make the file private. Requires $secret to be set in the config.
|
||||||
|
|
||||||
|
Config options (~/.suprc):
|
||||||
|
secret # Your personal token. Get it at https://zfh.so/settings_form
|
||||||
|
cfg_screenshot_ext # Screenshot file type, used by scrot.
|
||||||
|
# Others are self-explanatory:
|
||||||
|
cfg_url_regex
|
||||||
|
cfg_tmp_dir
|
||||||
|
cfg_script_url
|
||||||
|
29
sup
29
sup
@@ -13,11 +13,33 @@ cfg_screenshot_ext='png'
|
|||||||
|
|
||||||
[[ -f $HOME/.suprc ]] && { source "$HOME/.suprc"; }
|
[[ -f $HOME/.suprc ]] && { source "$HOME/.suprc"; }
|
||||||
|
|
||||||
|
_cat() {
|
||||||
|
while read; do
|
||||||
|
printf '%s\n' "$REPLY"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
sup.msg() { printf '%s\n' "[sup] $1"; }
|
sup.msg() { printf '%s\n' "[sup] $1"; }
|
||||||
sup.err() { sup.msg "(error) $1" >&2; }
|
sup.err() { sup.msg "(error) $1" >&2; }
|
||||||
|
|
||||||
sup.usage() {
|
sup.usage() {
|
||||||
printf '%s\n' "Usage: ${_self} [-RsF] [-D num] [file/url]"
|
_cat <<- EOF
|
||||||
|
Usage: ${_self} [-RsF] [-D num] [file/url]"
|
||||||
|
Flags:
|
||||||
|
-R # Remove the file after uploading.
|
||||||
|
-s # Make a screenshot and upload it instead of a file.
|
||||||
|
-F # Make a fullscreen shot instead of prompting for a window/area. Implies -s.
|
||||||
|
-D <num> # Delay the shot by <num> seconds.
|
||||||
|
-p # Make the file private. Requires \$secret to be set in the config.
|
||||||
|
|
||||||
|
Config options (~/.suprc):
|
||||||
|
secret # Your personal token. Get it at https://zfh.so/settings_form
|
||||||
|
cfg_screenshot_ext # Screenshot file type, used by scrot.
|
||||||
|
# Others are self-explanatory:
|
||||||
|
cfg_url_regex
|
||||||
|
cfg_tmp_dir
|
||||||
|
cfg_script_url
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
sup.env() {
|
sup.env() {
|
||||||
@@ -131,8 +153,11 @@ main() {
|
|||||||
-R|--remove-file) flag_rm='1';;
|
-R|--remove-file) flag_rm='1';;
|
||||||
|
|
||||||
-s|--screenshot) flag_scrot='1';;
|
-s|--screenshot) flag_scrot='1';;
|
||||||
-F|--fullscreen) flag_scrot_fullscreen='1';;
|
|
||||||
-D|--screenshot-delay) cfg_scrot_delay="$2"; shift;;
|
-D|--screenshot-delay) cfg_scrot_delay="$2"; shift;;
|
||||||
|
-F|--fullscreen)
|
||||||
|
flag_scrot='1'
|
||||||
|
flag_scrot_fullscreen='1'
|
||||||
|
;;
|
||||||
|
|
||||||
-h|--help|--usage) sup.usage; return;;
|
-h|--help|--usage) sup.usage; return;;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user