Skip to content

Commit ebd30c5

Browse files
Refactor: Clarify required options for buy and scale commands
Co-authored-by: danieltaox <[email protected]>
1 parent 6110372 commit ebd30c5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/lib/buy/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function _registerBuy(program: Command) {
4747
.showHelpAfterError()
4848
.option(
4949
"-t, --type <type>",
50-
"Type of GPU",
50+
"[Required: --type or --zone or --colocate] Type of GPU",
5151
)
5252
.option(
5353
"-n, --accelerators <quantity>",
@@ -57,7 +57,7 @@ export function _registerBuy(program: Command) {
5757
)
5858
.option(
5959
"-d, --duration <duration>",
60-
"Duration of reservation (rounded up to the nearest hour)",
60+
"[Required: --duration or --end] Duration of reservation (rounded up to the nearest hour)",
6161
parseDuration,
6262
)
6363
.option(
@@ -73,7 +73,7 @@ export function _registerBuy(program: Command) {
7373
.addOption(
7474
new Option(
7575
"-e, --end <end>",
76-
"End time (date or relative time like '+1d', rounded up to nearest hour)",
76+
"[Required: --duration or --end] End time (date or relative time like '+1d', rounded up to nearest hour)",
7777
)
7878
.argParser(parseEnd)
7979
.conflicts("duration"),
@@ -91,7 +91,7 @@ export function _registerBuy(program: Command) {
9191
.option("-y, --yes", "Automatically confirm the order")
9292
.option(
9393
"-colo, --colocate <contract_id>",
94-
"Colocate with existing contracts. If provided, `-t`/`--type` will be ignored.",
94+
"[Required: --type or --zone or --colocate] Colocate with existing contracts. If provided, `-t`/`--type` will be ignored.",
9595
)
9696
.option(
9797
"-q, --quote",
@@ -103,11 +103,11 @@ export function _registerBuy(program: Command) {
103103
)
104104
.option(
105105
"-z, --zone <zone>",
106-
"Send into a specific zone. If provided, \`-t\`/`--type` will be ignored.",
106+
"[Required: --type or --zone or --colocate] Send into a specific zone. If provided, \`-t\`/`--type` will be ignored.",
107107
)
108108
.option(
109109
"-c, --cluster <cluster>",
110-
"Send into a specific cluster (deprecated, alias for --zone). If provided, \`-t\`/`--type` will be ignored.",
110+
"[Required: --type or --zone or --colocate] Send into a specific cluster (deprecated, alias for --zone). If provided, \`-t\`/`--type` will be ignored.",
111111
)
112112
.hook("preAction", (command) => {
113113
const { type, zone, cluster, colocate } = command.opts();

src/lib/scale/update.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,17 +358,17 @@ $ sf scale update <procurement_id...> -p 1.50
358358
.argument("<procurement_id...>", "ID of the procurement to update")
359359
.option(
360360
"-n, --accelerators <accelerators>",
361-
"Desired number of GPUs (0 to turn off)",
361+
"[Required: at least one of --accelerators, --horizon, or --price] Desired number of GPUs (0 to turn off)",
362362
parseAccelerators,
363363
)
364364
.option(
365365
"-d, --horizon <horizon>",
366-
"The minimum amount of time to reserve the GPUs for. That is, start buying more compute if the remaining time is less than this threshold.",
366+
"[Required: at least one of --accelerators, --horizon, or --price] The minimum amount of time to reserve the GPUs for. That is, start buying more compute if the remaining time is less than this threshold.",
367367
parseHorizonArg,
368368
)
369369
.option(
370370
"-p, --price <price>",
371-
"Limit price per GPU per hour, in dollars. Buy compute only if it's at most this price. Defaults to the current market price times 1.5, or $2.65 if we can't get a price estimate.",
371+
"[Required: at least one of --accelerators, --horizon, or --price] Limit price per GPU per hour, in dollars. Buy compute only if it's at most this price. Defaults to the current market price times 1.5, or $2.65 if we can't get a price estimate.",
372372
parsePriceArg,
373373
)
374374
.option("-y, --yes", "Automatically confirm the command.")

0 commit comments

Comments
 (0)