mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
add/run/import-url: don't use -f as --file (#4004)
If anything, `-f` is closer to `--force` than to `--file`. So let's set this straight.
This commit is contained in:
@@ -57,7 +57,6 @@ def add_parser(subparsers, parent_parser):
|
||||
help="Allow targets that are outside of the DVC repository.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-f",
|
||||
"--file",
|
||||
help="Specify name of the DVC-file this command will generate.",
|
||||
metavar="<filename>",
|
||||
|
||||
@@ -57,7 +57,6 @@ def add_parser(subparsers, parent_parser):
|
||||
"out", nargs="?", help="Destination path to put files to."
|
||||
)
|
||||
import_parser.add_argument(
|
||||
"-f",
|
||||
"--file",
|
||||
help="Specify name of the DVC-file this command will generate.",
|
||||
metavar="<filename>",
|
||||
|
||||
@@ -159,7 +159,6 @@ def add_parser(subparsers, parent_parser):
|
||||
metavar="<path>",
|
||||
)
|
||||
run_parser.add_argument(
|
||||
"-f",
|
||||
"--file",
|
||||
help="Specify name of the DVC-file this command will generate.",
|
||||
metavar="<filename>",
|
||||
|
||||
@@ -449,20 +449,20 @@ class TestShouldThrowProperExceptionOnCorruptedStageFile(TestDvc):
|
||||
|
||||
class TestAddFilename(TestDvc):
|
||||
def test(self):
|
||||
ret = main(["add", self.FOO, self.BAR, "-f", "error.dvc"])
|
||||
ret = main(["add", self.FOO, self.BAR, "--file", "error.dvc"])
|
||||
self.assertNotEqual(0, ret)
|
||||
|
||||
ret = main(["add", "-R", self.DATA_DIR, "-f", "error.dvc"])
|
||||
ret = main(["add", "-R", self.DATA_DIR, "--file", "error.dvc"])
|
||||
self.assertNotEqual(0, ret)
|
||||
|
||||
with self.assertRaises(RecursiveAddingWhileUsingFilename):
|
||||
self.dvc.add(self.DATA_DIR, recursive=True, fname="error.dvc")
|
||||
|
||||
ret = main(["add", self.DATA_DIR, "-f", "data_directory.dvc"])
|
||||
ret = main(["add", self.DATA_DIR, "--file", "data_directory.dvc"])
|
||||
self.assertEqual(0, ret)
|
||||
self.assertTrue(os.path.exists("data_directory.dvc"))
|
||||
|
||||
ret = main(["add", self.FOO, "-f", "bar.dvc"])
|
||||
ret = main(["add", self.FOO, "--file", "bar.dvc"])
|
||||
self.assertEqual(0, ret)
|
||||
self.assertTrue(os.path.exists("bar.dvc"))
|
||||
self.assertFalse(os.path.exists("foo.dvc"))
|
||||
|
||||
@@ -53,8 +53,6 @@ class TestRun(TestDvc):
|
||||
out_no_cache1,
|
||||
"--outs-no-cache",
|
||||
out_no_cache2,
|
||||
"-f",
|
||||
fname,
|
||||
"--file",
|
||||
fname,
|
||||
cmd,
|
||||
|
||||
@@ -58,12 +58,6 @@ class TestImportFilename(TestDvc):
|
||||
fobj.write("content")
|
||||
|
||||
def test(self):
|
||||
ret = main(["import-url", "-f", "bar.dvc", self.external_source])
|
||||
self.assertEqual(0, ret)
|
||||
self.assertTrue(os.path.exists("bar.dvc"))
|
||||
|
||||
os.remove("bar.dvc")
|
||||
|
||||
ret = main(["import-url", "--file", "bar.dvc", self.external_source])
|
||||
self.assertEqual(0, ret)
|
||||
self.assertTrue(os.path.exists("bar.dvc"))
|
||||
|
||||
@@ -411,7 +411,7 @@ class TestReproDryNoExec(TestDvc):
|
||||
"run",
|
||||
"--no-exec",
|
||||
"--single-stage",
|
||||
"-f",
|
||||
"--file",
|
||||
DVC_FILE,
|
||||
*deps,
|
||||
"ls {}".format(
|
||||
@@ -818,7 +818,7 @@ class TestCmdReproChdir(TestDvc):
|
||||
[
|
||||
"run",
|
||||
"--single-stage",
|
||||
"-f",
|
||||
"--file",
|
||||
f"{dname}/Dvcfile",
|
||||
"-w",
|
||||
f"{dname}",
|
||||
|
||||
@@ -504,7 +504,7 @@ class TestCmdRunOverwrite(TestDvc):
|
||||
self.CODE,
|
||||
"-o",
|
||||
"out",
|
||||
"-f",
|
||||
"--file",
|
||||
"out.dvc",
|
||||
"--single-stage",
|
||||
"python",
|
||||
@@ -528,7 +528,7 @@ class TestCmdRunOverwrite(TestDvc):
|
||||
self.CODE,
|
||||
"-o",
|
||||
"out",
|
||||
"-f",
|
||||
"--file",
|
||||
"out.dvc",
|
||||
"--single-stage",
|
||||
"python",
|
||||
@@ -557,7 +557,7 @@ class TestCmdRunOverwrite(TestDvc):
|
||||
"--single-stage",
|
||||
"-o",
|
||||
"out",
|
||||
"-f",
|
||||
"--file",
|
||||
"out.dvc",
|
||||
"python",
|
||||
self.CODE,
|
||||
@@ -578,7 +578,7 @@ class TestCmdRunOverwrite(TestDvc):
|
||||
"run",
|
||||
"--overwrite",
|
||||
"--single-stage",
|
||||
"-f",
|
||||
"--file",
|
||||
"out.dvc",
|
||||
"-d",
|
||||
self.BAR,
|
||||
|
||||
Reference in New Issue
Block a user