.\" Copyright (c) 2010-2014 Florian Pritz, bluewind at xinu.at .\" 2011 Moritz Wilhelmy, mw at wzff.de .\" .\" Licensed under GPLv3 .\" (see COPYING for full license text) .\" .Dd July 20, 2014 .Dt FB 1 .Os .Sh NAME .Nm fb .Nd a shell-script client for https://paste.xinu.at .Sh SYNOPSIS .Nm .Op options .Ar file/directory ... .Nm .Op Fl dg .Op options .Ar ID/URL ... .Nm .Op Fl hv .Sh DESCRIPTION .Nm is a client to https://paste.xinu.at which allows the user to easily upload, delete or download files. By default, files will be uploaded as-is and a link to the file will be printed to stdout after each upload. If multiple files are uploaded a multipaste ( see .Fl m ) will be created automatically. .Pp Directories will be packed into a tarball with .Xr tar 1 and the resulting .Pa upload.tar file will be uploaded. If no arguments are given, data will be read from stdin into a temporary file that will be uploaded as soon as EOF is received. If the file being uploaded is bigger than 10MiB .Nm will query the server for the maximum upload size and abort the upload if the file would be rejected. Before terminating, .Nm will try to copy all links into the X clipboard if .Xr xclip 1 is installed. .Pp If you want to use paste.xinu.at, you need to create an account there and then run .Sq Nm Fl a to create an API key. .Sh OPTIONS .Bl -tag -width Ds .It Fl c Compress the files to be uploaded using .Xr gzip 1 . This affects all files including piped content and directories. If specified twice, .Xr xz 1 will be used rather than gzip. If used in conjunction with the -g option this decompresses the download before it's output to stdout. .It Fl d Delete the IDs. You can no longer upload files in this mode. If the argument is a URL, .Nm will try to extract the ID. .It Fl e Ar extension Change the extension used for highlighting. You can also do this if you have already uploaded the file by appending the extension to the URL. https://paste.xinu.at//bash will change the syntax highlighting to bash. .It Fl n Ar file name Use the specified file name for the upload when pasting from stdin. Defaults to "stdin" .It Fl a Create a new API key. Asks for username and password. .It Fl H Display a history of uploads. .It Fl g Download the IDs and output on stdout. Please take care when using this, as binary data may cause unexpected results when being output directly to a terminal. You can no longer upload files in this mode. If the argument is a URL, .Nm will try to extract the ID. .It Fl m Create a multipaste of the IDs/files/directories/URLs. This uploads files as always, but then creates a multipaste combining all of them. URLs starting with the pastebin URL will have their ID extracted and will not be downloaded. Only the multipaste URL will be copied to the clipboard, but all URLs will be displayed while uploading. This option is enabled automatically if multiple files are uploaded. .It Fl h Display a short help message. .It Fl t Upload a tar file containing all files and directories specified on the command line. The file name can be specified with the -n option. (don't add any extensions) .It Fl v Display the client version. .It Fl D Display debugging information. .El .Sh CONFIGURATION FILES .Bl -tag .It $XDG_CONFIG_HOME/fb-client/apikey This file contains the API key to use for authentication. If this file exists, netrc authentication will be disabled. .It $XDG_CONFIG_HOME/fb-client/config This file allows to override certain variables by using the format 'option_name="value"'. Both, the option value and name, are case-sensitive string literals. .Pp The following option names are supported: .Bl -tag .It pastebin The URL of the pastebin you want to use .It clipboard_cmd The command used to copy URLs of uploaded files to the clipboard. This defaults to pbcopy on Darwin and xclip otherwise. .It apikey_file The file that contains the API key. This defaults to "$XDG_CONFIG_HOME/fb-client/apikey" .El .It ~/.netrc Deprecated. This file will be used for authentication unless an API key is configured. Usage of this file is discouraged because it contains your username and password in plain text. .El .Sh ENVIRONMENT Some options can be changed by modifying environment variables: .Bl -tag -width XZ_OPTS .It Ev GZIP Assigning GZIP will make the gzip-program treat it's value as if they had been appended to the command line. .It Ev XZ_OPTS The XZ_OPTS environment variable can be used in order to pass additional options to xz, in case xz is used for compression. .It TMPDIR Setting TMPDIR to some directory where .Nm create temporary files inside this directory rather than /tmp, if the underlying .Xr mktemp 1 program supports it. .El .Sh EXAMPLES .Bl -tag .It Nm Fl tc Ar directory file This will create a .tar archive containing the directory and the file and compress it using gzip and upload one archive. .It Nm Fl c Ar directory file This will create a .tar archive containing only the directory. Both (directory and file) will be compressed using gzip and uploaded independently. .It Nm Fl cc Ar directory This will create a .tar archive containing only the directory and compress it using xz. .It Ic make \&|\&& Nm This will upload the output of make (stdout and stderr) in csh and similar shells. .El .Sh SEE ALSO .Xr curl 1 , .Xr gzip 1 , .Xr mktemp 1 , .Xr tar 1 , .Xr xz 1 , .Xr xclip 1 .Sh AUTHORS .An -nosplit .Nm was written by .Bl -bullet -compact .It .\" mdoc has clever spam protection ;) .An Florian Pritz Aq bluewi\&nd@xinu.at .It .An Moritz Wilhelmy Aq mor\&itz@wzff.de .El and may be copied under the terms of the GPLv3.