def add_options(self):
        """ Add program options.
        """
        super(MetafileChanger, self).add_options()

        self.add_bool_option("-n", "--dry-run",
            help="don't write changes to disk, just tell what would happen")
        self.add_bool_option("-V", "--no-skip",
            help="do not skip broken metafiles that fail the integrity check")
        self.add_value_option("-o", "--output-directory", "PATH",
            help="optional output directory for the modified metafile(s)")
        self.add_bool_option("-p", "--make-private",
            help="make torrent private (DHT/PEX disabled)")
        self.add_bool_option("-P", "--make-public",
            help="make torrent public (DHT/PEX enabled)")
        self.add_value_option("-s", "--set", "KEY=VAL [-s ...]",
            action="append", default=[],
            help="set a specific key to the given value; omit the '=' to delete a key")
        self.add_value_option("-r", "--regex", "KEYcREGEXcSUBSTc [-r ...]",
            action="append", default=[],
            help="replace pattern in a specific key by the given substitution")
        self.add_bool_option("-C", "--clean",
            help="remove all non-standard data from metafile outside the info dict")
        self.add_bool_option("-A", "--clean-all",
            help="remove all non-standard data from metafile including inside the info dict")
        self.add_bool_option("-X", "--clean-xseed",
            help="like --clean-all, but keep libtorrent resume information")
        self.add_bool_option("-R", "--clean-rtorrent",
            help="remove all rTorrent session data from metafile")
        self.add_value_option("-H", "--hashed", "--fast-resume", "DATAPATH",
            help="add libtorrent fast-resume information (use {} in place of the torrent's name in DATAPATH)")
        # TODO: chtor --tracker
        ##self.add_value_option("-T", "--tracker", "DOMAIN",
        ##    help="filter given torrents for a tracker domain")
        self.add_value_option("-a", "--reannounce", "URL",
            help="set a new announce URL, but only if the old announce URL matches the new one")
        self.add_value_option("--reannounce-all", "URL",
            help="set a new announce URL on ALL given metafiles")
        self.add_bool_option("--no-ssl",
            help="force announce URL to 'http'")
        self.add_bool_option("--no-cross-seed",
            help="when using --reannounce-all, do not add a non-standard field to the info dict ensuring unique info hashes")
        self.add_value_option("--comment", "TEXT",
            help="set a new comment (an empty value deletes it)")
        self.add_bool_option("--bump-date",
            help="set the creation date to right now")
        self.add_bool_option("--no-date",
            help="remove the 'creation date' field")
def add_options ( self ) : super ( MetafileChanger , self ) . add_options ( ) self . add_bool_option ( "-n" , "--dry-run" , help = "don't write changes to disk, just tell what would happen" ) self . add_bool_option ( "-V" , "--no-skip" , help = "do not skip broken metafiles that fail the integrity check" ) self . add_value_option ( "-o" , "--output-directory" , "PATH" , help = "optional output directory for the modified metafile(s)" ) self . add_bool_option ( "-p" , "--make-private" , help = "make torrent private (DHT/PEX disabled)" ) self . add_bool_option ( "-P" , "--make-public" , help = "make torrent public (DHT/PEX enabled)" ) self . add_value_option ( "-s" , "--set" , "KEY=VAL [-s ...]" , action = "append" , default = [ ] , help = "set a specific key to the given value; omit the '=' to delete a key" ) self . add_value_option ( "-r" , "--regex" , "KEYcREGEXcSUBSTc [-r ...]" , action = "append" , default = [ ] , help = "replace pattern in a specific key by the given substitution" ) self . add_bool_option ( "-C" , "--clean" , help = "remove all non-standard data from metafile outside the info dict" ) self . add_bool_option ( "-A" , "--clean-all" , help = "remove all non-standard data from metafile including inside the info dict" ) self . add_bool_option ( "-X" , "--clean-xseed" , help = "like --clean-all, but keep libtorrent resume information" ) self . add_bool_option ( "-R" , "--clean-rtorrent" , help = "remove all rTorrent session data from metafile" ) self . add_value_option ( "-H" , "--hashed" , "--fast-resume" , "DATAPATH" , help = "add libtorrent fast-resume information (use {} in place of the torrent's name in DATAPATH)" ) self . add_value_option ( "-a" , "--reannounce" , "URL" , help = "set a new announce URL, but only if the old announce URL matches the new one" ) self . add_value_option ( "--reannounce-all" , "URL" , help = "set a new announce URL on ALL given metafiles" ) self . add_bool_option ( "--no-ssl" , help = "force announce URL to 'http'" ) self . add_bool_option ( "--no-cross-seed" , help = "when using --reannounce-all, do not add a non-standard field to the info dict ensuring unique info hashes" ) self . add_value_option ( "--comment" , "TEXT" , help = "set a new comment (an empty value deletes it)" ) self . add_bool_option ( "--bump-date" , help = "set the creation date to right now" ) self . add_bool_option ( "--no-date" , help = "remove the 'creation date' field" )
Add program options.