diff options
| -rwxr-xr-x | rclone-ide | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -7,6 +7,8 @@ Rclone helper script for - uploading directories - downloading files - downloading directories + +better scriptifying of rclone calls for eg CLI IDEs :) """ @@ -65,7 +67,7 @@ def get_remote_config(remote: str = "") -> Optional[Mapping[str, Mapping[str, An global config - if remote != "": + if remote != "" and remote != "@": return { "remote": remote, "config": config[remote], @@ -73,7 +75,11 @@ def get_remote_config(remote: str = "") -> Optional[Mapping[str, Mapping[str, An else: if len(config.keys()) == 1: - return config.values[0] + remote_name = list(config.keys())[0] + return { + "remote": remote_name, + "config": config[remote_name] + } else: for remote_name in config.keys(): remote_config = config[remote_name] @@ -224,7 +230,7 @@ parser_set_remote_path.add_argument("remote_path") parser_copy_file = subparsers.add_parser("copy-file") -parser_copy_file.add_argument("remote", help="rclone remote to upload to", choices=config.keys()) +parser_copy_file.add_argument("remote", help="rclone remote to upload to. @ = default remote", choices=[*config.keys(), "@"]) parser_copy_file.add_argument("filepath", help="cwd-relative path to file") |
