浏览代码

docs: document good and problematic option placements, see #3356

(cherry picked from commit e3cb7c3c32620e36b792e99972167925c8bfbedf)
Thomas Waldmann 7 年之前
父节点
当前提交
21afd17f2f
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. 17 0
      docs/usage_general.rst.inc

+ 17 - 0
docs/usage_general.rst.inc

@@ -1,3 +1,20 @@
+Positional Arguments and Options: Order matters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Borg only supports taking options (``-s`` and ``--progress`` in the example)
+to the left or right of all positional arguments (``repo::archive`` and ``path``
+in the example), but not in between them:
+
+::
+
+    borg create -s --progress repo::archive path  # good and preferred
+    borg create repo::archive path -s --progress  # also works
+    borg create -s repo::archive path --progress  # works, but ugly
+    borg create repo::archive -s --progress path  # BAD
+
+This is due to a problem in the argparse module: http://bugs.python.org/issue15112
+
+
 Repository URLs
 ~~~~~~~~~~~~~~~