diff --git a/lib/ramble/ramble/cmd/workspace.py b/lib/ramble/ramble/cmd/workspace.py index 7a38a4c1e..46a81c47b 100644 --- a/lib/ramble/ramble/cmd/workspace.py +++ b/lib/ramble/ramble/cmd/workspace.py @@ -893,6 +893,14 @@ def workspace_edit_setup_parser(subparser): required=False, ) + subparser.add_argument( + "--all", + dest="all_files", + action="store_true", + help="Open all yaml and template files in workspace config directory", + required=False, + ) + subparser.add_argument( "-p", "--print-file", action="store_true", help="print the file name that would be edited" ) @@ -935,6 +943,8 @@ def workspace_edit(args): elif args.license_only: licenses_file = [ramble.workspace.licenses_file(ramble_ws)] edit_files = licenses_file + elif args.all_files: + edit_files = ramble.workspace.all_config_files(ramble_ws) + template_files if args.print_file: for f in edit_files: diff --git a/lib/ramble/ramble/workspace/__init__.py b/lib/ramble/ramble/workspace/__init__.py index 85992a07c..0eb66ea55 100644 --- a/lib/ramble/ramble/workspace/__init__.py +++ b/lib/ramble/ramble/workspace/__init__.py @@ -38,6 +38,7 @@ modifiers_file_name, software_file, software_file_name, + all_config_files, licenses_file, licenses_file_name, metadata_file_name, @@ -84,6 +85,7 @@ "modifiers_file_name", "software_file", "software_file_name", + "all_config_files", "licenses_file", "licenses_file_name", "metadata_file_name", diff --git a/lib/ramble/ramble/workspace/workspace.py b/lib/ramble/ramble/workspace/workspace.py index 5d4a2c775..db5ac755c 100644 --- a/lib/ramble/ramble/workspace/workspace.py +++ b/lib/ramble/ramble/workspace/workspace.py @@ -292,6 +292,18 @@ def licenses_file(path): return get_yaml_filepath(path, licenses_file_name) +def all_config_files(path): + """Returns path to all yaml files in workspace config directory""" + config_files = [] + + config_path = os.path.join(path, workspace_config_path) + for f in os.listdir(config_path): + if f.endswith(".yaml"): + config_files.append(os.path.join(config_path, f)) + + return config_files + + def template_path(ws_path, requested_template_name): """Returns the path to a workspace's template file""" config_path = os.path.join(ws_path, workspace_config_path) diff --git a/share/ramble/ramble-completion.bash b/share/ramble/ramble-completion.bash index 3ac5cbbe5..2b487a2c4 100755 --- a/share/ramble/ramble-completion.bash +++ b/share/ramble/ramble-completion.bash @@ -693,7 +693,7 @@ _ramble_workspace_info() { } _ramble_workspace_edit() { - RAMBLE_COMPREPLY="-h --help -c --config_only -a --applications_only -m --modifiers_only -s --software_only -t --template_only -l --license_only -p --print-file" + RAMBLE_COMPREPLY="-h --help -c --config_only -a --applications_only -m --modifiers_only -s --software_only -t --template_only -l --license_only --all -p --print-file" } _ramble_workspace_mirror() {