From 9258b84695732ae13cf3ce07eb5befea2fe066dd Mon Sep 17 00:00:00 2001 From: AndCycle Date: Mon, 20 Aug 2018 09:00:51 +0200 Subject: [PATCH] Allow reading arguments from file Squashed commit of the following (pr #161): commit 58235a99b04a975d825f4f8f8431a6dcb7acccdc Author: AndCycle Date: Thu Aug 16 17:57:26 2018 +0800 doc: proper fix rst syntax commit 6620e3583c0b59e9447bcc44e5f573c61d02e6de Author: AndCycle Date: Thu Aug 16 17:29:25 2018 +0800 doc: fix syntax commit 7a048a3c0440ad900917eb865b72dcfb348da879 Author: AndCycle Date: Thu Aug 16 17:09:26 2018 +0800 doc: add info about read args from file. commit c4ceaf96365422f25357c54af03aadfa7222ce44 Author: AndCycle Date: Thu Aug 16 17:05:07 2018 +0800 alter `fromfile_prefix_chars` to plus sign to avoid conflict. commit d469b52b95de6bf86761b9315a78ecda2b033ac2 Author: AndCycle Date: Mon Aug 6 19:10:23 2018 +0800 * Allow reading arguments from file function referenced from instagram-scraper, which provide a convenient way to hide sensitive information. --- docs/cli-options.rst | 17 +++++++++++++++++ instaloader/__main__.py | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/cli-options.rst b/docs/cli-options.rst index 2b6e6fc..1b585e9 100644 --- a/docs/cli-options.rst +++ b/docs/cli-options.rst @@ -192,3 +192,20 @@ Miscellaneous Options Disable user interaction, i.e. do not print messages (except errors) and fail if login credentials are needed but not given. This is handy for running :ref:`instaloader-as-cronjob`. + +.. option:: +args.txt + + Read arguments from file `args.txt`, a shortcut to provide argument from + file rather than command-line. This provide a convient way to hide login + info from CLI. and also can use for simplify managment of long arguments. + + .. note:: + + text file should separate arg with line break. + + args.txt example:: + + --login MYUSENAME + --password MYPASSWORD + --fast-update + diff --git a/instaloader/__main__.py b/instaloader/__main__.py index a8f5aae..f340c6d 100644 --- a/instaloader/__main__.py +++ b/instaloader/__main__.py @@ -207,7 +207,8 @@ def main(): parser = ArgumentParser(description=__doc__, add_help=False, usage=usage_string(), epilog="Report issues at https://github.com/instaloader/instaloader/issues. " "The complete documentation can be found at " - "https://instaloader.github.io/.") + "https://instaloader.github.io/.", + fromfile_prefix_chars='+') g_what = parser.add_argument_group('What to Download', 'Specify a list of profiles or #hashtags. For each of these, Instaloader '