Module: Paperback::CLI

Defined in:
lib/paperback/cli.rb

Class Method Summary collapse

Class Method Details

.create_backup(input:, output:, encrypt: true, qr_base64: true, qr_level: :l, comment: nil, passphrase_file: nil, extra_draw_opts: {}, include_base64: true) ⇒ Object

Top level CLI interface for Paperback. This is the one stop shop for calling paperback.

Parameters:

  • The input filename

  • The output PDF filename

  • (defaults to: true)

    Whether to encrypt input with GPG.

  • (defaults to: true)

    Whether to base64 the data before encoding it as a QR code

  • (defaults to: :l)

    Which level of QR code encoding, default :l

  • (defaults to: nil)

    A comment to add to the printout

  • (defaults to: nil)

    A file to write the generated GPG passphrase to

  • (defaults to: {})

    Other options passed to

    Paperback::Preparer#render
  • (defaults to: true)

    Whether to include a Base64 copy of the input



21
22
23
24
25
26
27
28
29
30
# File 'lib/paperback/cli.rb', line 21

def self.create_backup(input:, output:, encrypt: true, qr_base64: true,
                       qr_level: :l, comment: nil, passphrase_file: nil,
                       extra_draw_opts: {}, include_base64: true)
  prep = Paperback::Preparer.new(filename: input, encrypt: encrypt,
                                 qr_base64: qr_base64, qr_level: qr_level,
                                 passphrase_file: passphrase_file,
                                 comment: comment,
                                 include_base64: include_base64)
  prep.render(output_filename: output, extra_draw_opts: extra_draw_opts)
end