You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-overlay/app-text/wgetpaste/files/wgetpaste-2.33-add-paste-ca...

73 lines
3.0 KiB

--- a/wgetpaste 2023-11-05 01:00:11.421397200 +0300
+++ b/wgetpaste 2023-11-05 01:08:36.145761741 +0300
@@ -41,7 +41,18 @@
}
### services
-SERVICES="0x0 bpaste codepad dpaste gists ix_io pgz snippets"
+SERVICES="0x0 bpaste codepad dpaste gists ix_io pgz snippets calculate"
+# calculate
+ENGINE_calculate=calculate
+if [[ "$LANG" =~ 'ru_RU' ]]; then
+ URL_calculate="http://pastebin.calculate-linux.ru"
+else
+ URL_calculate="http://pastebin.calculate-linux.org"
+fi
+DEFAULT_LANGUAGE_calculate="Text"
+DEFAULT_PARENT_calculate=""
+DEFAULT_PRIVATE_calculate=0
+SIZE_calculate="25000 25%kB"
# 0x0
ENGINE_0x0=0x0
URL_0x0="http://0x0.st"
@@ -89,6 +100,22 @@
# 0x0
escape_description_0x0() { echo "$*"; }
escape_input_0x0() { echo "$*"; }
+LANGUAGES_calculate="Apache Bash Batch Boo C C# C++ Clojure Creole_Wiki CSS \
+CSV D Debian_control-files Django_Jinja_Templates Dylan Erlang eRuby_rhtml GAS GCC_Messages \
+Genshi_Templates Gettext_catalogs GL_Shader_language Haskell HTML INI_File Interactive_Ruby IO \
+IRC_Logs Java javac_Messages JavaScript JSP Lighttpd Literate_Haskell LLVM Lua Mako_Templates Matlab \
+Matlab_Session MiniD Multi-File Myghty_Templates MySQL Nasm Nginx Object-Pascal OCaml Perl PHP \
+PHP_(inline) Povray Python Python_Console_Sessions Python_Tracebacks reStructuredText Ruby Scala \
+Scheme Smalltalk Smarty sources.list SQL SquidConf TeX_LaTeX Text Unified_Diff Vim XML XSLT YAML"
+LANGUAGE_VALUES_calculate="apache bash bat boo c csharp cpp clojure creole css csv d control html+django \
+dylan erlang rhtml gas gcc-messages html+genshi gettext glsl haskell html ini irb io irc java \
+javac-messages js jsp lighttpd literate-haskell llvm lua html+mako matlab matlabsession minid multi \
+html+myghty mysql nasm nginx objectpascal ocaml perl html+php php povray python pycon pytb rst ruby \
+scala scheme smalltalk smarty sourceslist sql squidconf tex text diff vim xml xslt yaml"
+REGEX_RAW_calculate='s|^\(http://[^/]*/\)show\(/[0-9]*/\)$|\1raw\2|'
+POST_calculate() {
+ POST_generic "submit=paste! parent private language % % text" "$PARENT" "$PRIVATE" "$3" "$4" "$5" "$6"
+}
POST_0x0() {
local filename="${2}"
local content="${6}" boundary="WGETPASTE-yuLr+iHOSQ+trEgDcj9UVq5R302bid"
@@ -562,6 +589,8 @@
-q, --quiet show the url only
-v, --verbose show wget stderr output if no url is received
--completions emit output suitable for shell completions (only affects --list-*)
--debug be *very* verbose (implies -v)
+ -p, --parent PARENT [service calculate only!] set parent paste as -p <id> paste
+ -P, --private PRIVATE [service calculate only!] set private status as -P <seed>
-h, --help show this help
@@ -847,6 +876,17 @@
-C | --xclippaste )
XCLIPPASTE=0
;;
+ -p | --parent )
+ requiredarg "$@"
+ PARENTSET=0
+ PARENT="$2"
+ ;;
+ -P | --private )
+ requiredarg "$@"
+ PRIVATESET=0
+ PRIVATE="$2"
+ ;;
+
-* )
die "$0: unrecognized option \`$1'"
;;