Merge pull request #159 from pubs/fix/doc_add
Fixes #144: behavior of add_copy mode during add. - correctly handles `add_copy` mode and configuration, - adds option top force 'copy' mode in `add` command, - reverts default to `copy` instead of move for the `add` command, - fixes assumption in tests about the default, - do not try to delete the source when it is an URL, - set default to `copy` during `import` commands and provides option for `move` or `link` alternatives.main
commit
4f57aecfa4
@ -0,0 +1,18 @@
|
|||||||
|
"""Contains code that is reused over commands, like argument definition
|
||||||
|
or help messages.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def add_doc_copy_arguments(parser, copy=True):
|
||||||
|
doc_add_group = parser.add_mutually_exclusive_group()
|
||||||
|
doc_add_group.add_argument(
|
||||||
|
'-L', '--link', action='store_const', dest='doc_copy', const='link',
|
||||||
|
default=None,
|
||||||
|
help="don't copy document files, just create a link.")
|
||||||
|
if copy:
|
||||||
|
doc_add_group.add_argument(
|
||||||
|
'-C', '--copy', action='store_const', dest='doc_copy', const='copy',
|
||||||
|
help="copy document (keep source).")
|
||||||
|
doc_add_group.add_argument(
|
||||||
|
'-M', '--move', action='store_const', dest='doc_copy', const='move',
|
||||||
|
help="move document (copy and remove source).")
|
Loading…
Reference in new issue