Add --solid.

This commit is contained in:
voussoir 2020-11-20 01:55:03 -08:00
parent 555878e511
commit 09ac7a4715

View file

@ -39,6 +39,7 @@ def RARCOMMAND(
profile=None, profile=None,
rec=None, rec=None,
rev=None, rev=None,
solid=False,
volume=None, volume=None,
): ):
''' '''
@ -54,6 +55,7 @@ def RARCOMMAND(
-v{x}M = split into x megabyte volumes -v{x}M = split into x megabyte volumes
-ri x:y = x priority (lower is less pri) y ms sleep between ops -ri x:y = x priority (lower is less pri) y ms sleep between ops
-r = include subdirectories -r = include subdirectories
-s = solid
-ep1 = arcnames will start relative to the main folder, -ep1 = arcnames will start relative to the main folder,
instead of having the whole abspath of the input_pattern. instead of having the whole abspath of the input_pattern.
-rr{x}% = x% recovery record -rr{x}% = x% recovery record
@ -79,6 +81,9 @@ def RARCOMMAND(
if compression is not None: if compression is not None:
command.append(f'-m{compression}') command.append(f'-m{compression}')
if solid:
command.append('-s')
if volume is not None: if volume is not None:
command.append(f'-v{volume}M') command.append(f'-v{volume}M')
@ -265,6 +270,7 @@ def rarpar(
recycle_original=False, recycle_original=False,
rec=None, rec=None,
rev=None, rev=None,
solid=False,
volume=None, volume=None,
workdir='.', workdir='.',
): ):
@ -281,6 +287,9 @@ def rarpar(
pathsize = path.size pathsize = path.size
if type(solid) is not bool:
raise TypeError(f'solid must be True or False, not {solid}.')
volume = normalize_volume(volume, pathsize) volume = normalize_volume(volume, pathsize)
rec = _normalize_percentage(rec) rec = _normalize_percentage(rec)
rev = _normalize_percentage(rev) rev = _normalize_percentage(rev)
@ -323,6 +332,7 @@ def rarpar(
profile=rar_profile, profile=rar_profile,
rec=rec, rec=rec,
rev=rev, rev=rev,
solid=solid,
volume=volume, volume=volume,
workdir=workdir, workdir=workdir,
) )
@ -433,6 +443,7 @@ def rarpar_argparse(args):
rec=args.rec, rec=args.rec,
rev=args.rev, rev=args.rev,
recycle_original=args.recycle_original, recycle_original=args.recycle_original,
solid=args.solid,
workdir=args.workdir, workdir=args.workdir,
) )
@ -450,6 +461,7 @@ def main(argv):
parser.add_argument('--workdir', dest='workdir', default='.') parser.add_argument('--workdir', dest='workdir', default='.')
parser.add_argument('--moveto', dest='moveto') parser.add_argument('--moveto', dest='moveto')
parser.add_argument('--recycle', dest='recycle_original', action='store_true') parser.add_argument('--recycle', dest='recycle_original', action='store_true')
parser.add_argument('--solid', dest='solid', action='store_true')
parser.add_argument('--dry', dest='dry', action='store_true') parser.add_argument('--dry', dest='dry', action='store_true')
parser.set_defaults(func=rarpar_argparse) parser.set_defaults(func=rarpar_argparse)