diff --git a/lib/ramble/ramble/cmd/workspace.py b/lib/ramble/ramble/cmd/workspace.py index 7a38a4c1e..700719bb8 100644 --- a/lib/ramble/ramble/cmd/workspace.py +++ b/lib/ramble/ramble/cmd/workspace.py @@ -875,6 +875,14 @@ def workspace_edit_setup_parser(subparser): required=False, ) + subparser.add_argument( + "--all", + dest="all_config", + action="store_true", + help="Open all yaml files in workspace config directory", + required=False, + ) + subparser.add_argument( "-t", "--template_only", @@ -930,6 +938,8 @@ def workspace_edit(args): edit_files = [modifiers_file] elif args.software_only: edit_files = [software_file] + elif args.all_config: + edit_files = ramble.workspace.all_config_files(ramble_ws) elif args.template_only: edit_files = template_files elif args.license_only: 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..569c88515 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 --all -t --template_only -l --license_only -p --print-file" } _ramble_workspace_mirror() {