Skip to content

Commit 2c351ce

Browse files
authored
fix sandbox create & improve volumes create ergonomics (#39)
1 parent 028351e commit 2c351ce

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

sandbox/mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const sandboxCreateCommand = new Command<SandboxContext>()
3131
.option("--ssh", "SSH into the sandbox")
3232
.option("--expose-http <port:number>", "Expose the specified port")
3333
.option("--memory <value:string>", "Memory limit for the sandbox")
34-
.arguments("<command...>")
34+
.arguments("[command...]")
3535
.example(
3636
"Create a sandbox and run a command",
3737
"new ls /",

sandbox/volumes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { tablePrinter } from "../util.ts";
66

77
export const volumesCreateCommand = new Command<SandboxContext>()
88
.description("Create a volume")
9-
.option("--name <string>", "The name of the volume", { required: true })
109
.option("--capacity <string|number>", "The capacity of the volume", {
1110
required: true,
1211
})
1312
.option("--region <string>", "The region of the volume", { required: true })
14-
.action(async (options) => {
13+
.arguments("<name>")
14+
.action(async (options, name) => {
1515
const org = await ensureOrg(options);
1616
const token = await getAuth(options.debug, options.endpoint, true);
1717

@@ -22,7 +22,7 @@ export const volumesCreateCommand = new Command<SandboxContext>()
2222
});
2323

2424
const volume = await client.volumes.create({
25-
slug: options.name,
25+
slug: name,
2626
capacity: options.capacity as VolumeInit["capacity"],
2727
region: options.region,
2828
});

0 commit comments

Comments
 (0)