diff --git a/tqdm.1 b/tqdm.1 index d1b05888..762186df 100644 --- a/tqdm.1 +++ b/tqdm.1 @@ -221,6 +221,12 @@ If true, will count bytes, ignore \f[C]delim\f[], and default .RS .RE .TP +.B \-\-man_path=\f[I]man_path\f[] +str, optional. +Directory in which to install tqdm man pages. +.RS +.RE +.TP .B \-\-log=\f[I]log\f[] str, optional. CRITICAL|FATAL|ERROR|WARN(ING)|[default: \[aq]INFO\[aq]]|DEBUG|NOTSET. diff --git a/tqdm/_main.py b/tqdm/_main.py index 86b933c6..2d32ac59 100644 --- a/tqdm/_main.py +++ b/tqdm/_main.py @@ -109,6 +109,8 @@ CLI_EXTRA_DOC = r""" bytes : bool, optional If true, will count bytes, ignore `delim`, and default `unit_scale` to True, `unit_divisor` to 1024, and `unit` to 'B'. + man_path : str, optional + Directory in which to install tqdm man pages. log : str, optional CRITICAL|FATAL|ERROR|WARN(ING)|[default: 'INFO']|DEBUG|NOTSET. """ @@ -189,6 +191,16 @@ Options: buf_size = tqdm_args.pop('buf_size', 256) delim = tqdm_args.pop('delim', '\n') delim_per_char = tqdm_args.pop('bytes', False) + man_path = tqdm_args.pop('man_path', None) + if man_path is not None: + from os import path + from shutil import copyfile + fi = path.dirname(path.dirname(path.abspath(__file__))) + fi = path.join(fi, 'tqdm.1') + fo = path.join(man_path, 'tqdm.1') + copyfile(fi, fo) + log.info("written:" + fo) + sys.exit(0) if delim_per_char: tqdm_args.setdefault('unit', 'B') tqdm_args.setdefault('unit_scale', True)