lodgeit retrieves and creates pastes. The general syntax is:
lodgeit [global options] action [options] [arguments]
lodgeit supports different pastebins. The pastebin can be chosen with the lodgeit --pastebin:
Chose the pastebin to use. It can either be a hostname of one of the builtin pastebins or a URL to the start page of a pastebin site based on the Lodgeit software. The following pastebins are builtin:
The default pastebin can be configured with the pastebin configuration key.
The new action creates a new paste paste from the given filename. If no filename is given, or if a single dash - is specified, the paste is read from standard input. A parent paste [1] may be specified as id or url. If parent is not given, the new paste has no parent:
lodgeit new [options] [filename] [parent]
The following options are available:
Copy the url of the created paste to the clipboard. Enabled by default, can be configured with the configuration key copy.
Do not copy the url of the created paste to the clipboard.
Open the created paste in the favourite web browser. On Unix-Systems you should set $BROWSER to something reasonable. The default can be configured with the configuration key browser.
Do not open the paste in the browser.
Create a private paste. Private pastes do not have a nummeric id and do not appear in the public list of all pastes. The default can be configured with the configuration key private.
Create a public paste.
The get action fetches the given paste. paste can be a paste id or a complete paste url. If no paste is given, the last public paste is fetched:
lodgeit get [options] [paste]
The following options are available:
Write the paste to the specified file. If OUTFILE is single dash - or if this option is not given, the paste is written to standard output.
Write a header with meta data before the paste. This header contains the following information:
The default can be configured with configured with the configuration key information.
Do not write the meta data header.
Use colored output. This will highlight the paste according to the language of the paste. If neither this option nor -nc are given, output is colored, if the output file is a tty. Can be configured with the configuration key color.
Do not use colored output.
The color scheme to use, if colored output is enabled. Use light for terminals with a light background color and dark for terminals with a dark background color. The default can be configured with the configuration key colorscheme.
Some options have configurable defaults, which can be adjusted with the following configuration keys:
The default pastebin. See lodgeit --pastebin for a description of this setting and permitted values. The default is paste.pocoo.org.
The default language for new pastes. Corresponds to lodgeit new -l.
Boolean key providing the default setting for lodgeit new -c and lodgeit new -nc. If true, copying of paste urls is enabled, if false (the default), it’s disabled.
Boolean key providing the default setting for lodgeit new -b and lodgeit new -nb. If true, browsing of new pastes urls is enabled, if false (the default), it’s disabled.
Boolean key providing the default setting for lodgeit new -p and lodgeit new -np. If true, new pastes are private by default, if false (the default), they are public.
Provides the default encoding for input files for lodgeit get. Corresponds to lodgeit new --encoding.
Boolean key providing the default setting for lodgeit get -i and lodgeit get -ni. If true, a header is written by default, if false (the default), the header is suppressed.
Boolean key providing the default setting for lodgeit get -c and lodgeit get -nc. If true, a output is colored by default, if false, it’s not. If unset, colored output is only used on TTYs.
The default color scheme for colored output. Corresponds to lodgeit get -s, see the option description for permitted values. The default is dark.
Boolean configuration keys are true, if their value is any of true, yes, on and 1 (not case sensitive) and false, if their value is any of false, no, off and 0 (again not case sensitive). Other values cause an error.
The configuration file uses classic INI-style syntax. Keys and values are separated with =, comments are started with #:
encoding = utf-8
# open the browser
browser = yes
# do not copy url to clipboard
copy = false
On POSIX systems, the configuration file is read from $XDG_CONFIG_HOME/lodgeitrc. XDG_CONFIG_HOME defaults to $HOME/.config. On Windows the configuration is read from $APPDATA/lodgeitrc.
Create a new paste:
lodgeit new foo.py
Create a new private paste:
lodgeit new -p foo.py
Open the new paste in the browser:
lodgeit new -b foo.py
Fetch the last paste:
lodgeit get
Show the information header:
lodgeit get -i
Fetch a paste by id:
lodgeit get C76X4sCbP3FEUCDBbFGa
Or by a complete url:
lodgeit get 'http://paste.pocoo.org/show/C76X4sCbP3FEUCDBbFGa/'
Fetch and save a paste:
lodgeit get -o hello.py C76X4sCbP3FEUCDBbFGa
Footnotes
[1] | (1, 2) See Advanced Features for a description of this feature. |