You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: watermark.rb
    path of file: ./repos/hexapdf/lib/hexapdf/cli
    
    the code of the file until where you have to start completion: # -*- encoding: utf-8; frozen_string_literal: true -*-
#
#--
# This file is part of HexaPDF.
#
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
# Copyright (C) 2014-2024 Thomas Leitner
#
# HexaPDF is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License version 3 as
# published by the Free Software Foundation with the addition of the
# following permission added to Section 15 as permitted in Section 7(a):
# FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
# THOMAS LEITNER, THOMAS LEITNER DISCLAIMS THE WARRANTY OF NON
# INFRINGEMENT OF THIRD PARTY RIGHTS.
#
# HexaPDF is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. Se
    
      def initialize #:nodoc:
        super('watermark', takes_commands: false)
        short_desc("Put one or more PDF pages onto another PDF")
        long_desc(<<~EOF)
          This command uses one ore more pages from a PDF file and applies them as background or
          stamp on another PDF file.

          If multiple pages are selected from the watermark PDF, the --repeat option can be used to
          specify how they should be applied: 'last' (the default) will only repeat the last
          watermark page whereas 'all' will cyclically repeat all watermark pages.
        EOF

        options.on("-w", "--watermark-file FILE", "The PDF used as watermark") do |watermark_file|
          @watermark_file = watermark_file
        end
        options.on("-i", "--pages PAGES", "The pages of the watermark file that should be used " \
                   "(default: 1)") do |pages|
          @pages = pages
        end
        options.on("-r", "--repeat REPEAT_MODE", [:last, :all],
                   "Specifies how the watermark pages should be repeated. Either last or " \
                     "all (default: last)") do |repeat|
          @repeat = repeat
        end
        options.on("-t", "--type WATERMARK_TYPE", [:background, :stamp],
                   "Specifies how the watermark is applied: background applies it below the page " \
                     "contents and stamp applies it above. Default: background") do |type|
          @type = (type == :background ? :underlay : :overlay)
        end
        options.on("--password PASSWORD", "-p", String,
                   "The password for decrypting the input PDF. Use - for reading from " \
                     "standard input.") do |pwd|
          @password = (pwd == '-' ? read_password : pwd)
        end
        define_optimization_options
        define_encryption_options

        @watermark_file = nil
        @pages = "1"
        @repeat = :last
        @type = :underlay
        @password = nil
      end