Skip to content

Fix docs to reflect new codegate workspace subcommand #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/codegate/pipeline/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ async def _add_workspace(self, args: List[str]) -> str:
Add a workspace
"""
if args is None or len(args) == 0:
return "Please provide a name. Use `codegate-workspace add your_workspace_name`"
return "Please provide a name. Use `codegate workspace add your_workspace_name`"

new_workspace_name = args[0]
if not new_workspace_name:
return "Please provide a name. Use `codegate-workspace add your_workspace_name`"
return "Please provide a name. Use `codegate workspace add your_workspace_name`"

workspace_created = await self.workspace_crud.add_workspace(new_workspace_name)
if not workspace_created:
Expand All @@ -83,17 +83,17 @@ async def _activate_workspace(self, args: List[str]) -> str:
Activate a workspace
"""
if args is None or len(args) == 0:
return "Please provide a name. Use `codegate-workspace activate workspace_name`"
return "Please provide a name. Use `codegate workspace activate workspace_name`"

workspace_name = args[0]
if not workspace_name:
return "Please provide a name. Use `codegate-workspace activate workspace_name`"
return "Please provide a name. Use `codegate workspace activate workspace_name`"

was_activated = await self.workspace_crud.activate_workspace(workspace_name)
if not was_activated:
return (
f"Workspace **{workspace_name}** does not exist or was already active. "
f"Use `codegate-workspace add {workspace_name}` to add it"
f"Use `codegate workspace add {workspace_name}` to add it"
)
return f"Workspace **{workspace_name}** has been activated"

Expand Down
4 changes: 2 additions & 2 deletions tests/pipeline/workspace/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ async def test_list_workspaces(mock_workspaces, expected_output):
"args, existing_workspaces, expected_message",
[
# Case 1: No workspace name provided
([], [], "Please provide a name. Use `codegate-workspace add your_workspace_name`"),
([], [], "Please provide a name. Use `codegate workspace add your_workspace_name`"),
# Case 2: Workspace name is empty string
([""], [], "Please provide a name. Use `codegate-workspace add your_workspace_name`"),
([""], [], "Please provide a name. Use `codegate workspace add your_workspace_name`"),
# Case 3: Successful add
(["myworkspace"], [], "Workspace **myworkspace** has been added"),
],
Expand Down
Loading