add comlpetion for new import/export

This commit is contained in:
Federico Luzzi 2023-09-13 15:36:06 -03:00
parent 4373a34711
commit 7856dcb9a3
2 changed files with 15 additions and 12 deletions

View File

@ -1,2 +1,2 @@
__version__ = "3.4.1" __version__ = "3.4.2"

View File

@ -45,7 +45,7 @@ def main():
wordsnumber = int(sys.argv[positions[0]]) wordsnumber = int(sys.argv[positions[0]])
words = sys.argv[positions[1]:] words = sys.argv[positions[1]:]
if wordsnumber == 2: if wordsnumber == 2:
strings=["--add", "--del", "--rm", "--edit", "--mod", "--show", "mv", "move", "ls", "list", "cp", "copy", "profile", "run", "bulk", "config", "api", "ai", "--help"] strings=["--add", "--del", "--rm", "--edit", "--mod", "--show", "mv", "move", "ls", "list", "cp", "copy", "profile", "run", "bulk", "config", "api", "ai", "export", "import", "--help"]
strings.extend(nodes) strings.extend(nodes)
strings.extend(folders) strings.extend(folders)
@ -66,22 +66,25 @@ def main():
strings=["profile"] strings=["profile"]
if words[0] in ["list", "ls"]: if words[0] in ["list", "ls"]:
strings=["profiles", "nodes", "folders"] strings=["profiles", "nodes", "folders"]
if words[0] in ["bulk", "mv", "cp", "copy", "run"]: if words[0] in ["bulk", "mv", "cp", "copy", "export"]:
strings=["--help"] strings=["--help"]
if words[0] in ["--rm", "--del", "-r"]: if words[0] in ["--rm", "--del", "-r", "export"]:
strings.extend(folders) strings.extend(folders)
if words[0] in ["--rm", "--del", "-r", "--mod", "--edit", "-e", "--show", "-s", "mv", "move", "cp", "copy"]: if words[0] in ["--rm", "--del", "-r", "--mod", "--edit", "-e", "--show", "-s", "mv", "move", "cp", "copy"]:
strings.extend(nodes) strings.extend(nodes)
if words[0] == "run": if words[0] in ["run", "import"]:
if words[-1] == "run": if words[-1] in ["run", "import"]:
path = './*' path = './*'
else: else:
path = words[-1] + "*" path = words[-1] + "*"
strings = glob.glob(path) pathstrings = glob.glob(path)
for i in range(len(strings)): for i in range(len(pathstrings)):
if os.path.isdir(strings[i]): if os.path.isdir(pathstrings[i]):
strings[i] += '/' pathstrings[i] += '/'
strings = [s[2:] if s.startswith('./') else s for s in strings] strings = ["--help"]
pathstrings = [s[2:] if s.startswith('./') else s for s in pathstrings]
strings.extend(pathstrings)
if words[0] == "run":
strings.extend(nodes) strings.extend(nodes)
elif wordsnumber == 4: elif wordsnumber == 4: