diff --git a/src/lib/nodes/create.ts b/src/lib/nodes/create.ts index 9470658..927ec83 100644 --- a/src/lib/nodes/create.ts +++ b/src/lib/nodes/create.ts @@ -75,11 +75,11 @@ const create = new Command("create") .showHelpAfterError() .argument( "[names...]", - "Names of the nodes to create (must be unique across your account)", + "[Required: names or --count] Names of the nodes to create (must be unique across your account)", ) .option( "-n, --count ", - "Number of nodes to create with auto-generated names", + "[Required: names or --count] Number of nodes to create with auto-generated names", validateCount, ) .addOption(zoneOption) @@ -87,7 +87,7 @@ const create = new Command("create") .addOption( new Option( "--reserved", - "Create reserved nodes. Reserved nodes have an explicit start and end time.", + "Create reserved nodes (default). Reserved nodes have an explicit start and end time.", ).conflicts("auto"), ) .addOption( @@ -192,6 +192,11 @@ const create = new Command("create") .addHelpText( "after", ` +Notes: + - Either provide node names as arguments OR use --count (one is required) + - For reserved nodes (default): either --duration or --end is required + - For auto-reserved nodes (--auto): --duration and --end are not allowed + Examples:\n \x1b[2m# Create a single reserved node(default type) that starts immediately\x1b[0m $ sf nodes create -n 1 --zone hayesvalley --max-price 12.50 --duration 1h @@ -206,7 +211,7 @@ Examples:\n $ sf nodes create node-1 --zone hayesvalley --reserved --start "2024-01-15T10:00:00Z" --end "2024-01-15T12:00:00Z" -p 15.00 \x1b[2m# Create a reserved node with custom user-data for 2 hours starting now \x1b[0m - $ sf nodes create node-1 --zone hayesvalley --reserved --user-data-file /path/to/cloud-init --duration 2h -p 13.50 + $ sf nodes create node-1 --zone hayesvalley --reserved --user-data-file /path/to/cloud-init --duration 2h -p 13.50 \x1b[2m# Create a reserved node starting in 1 hour for 6 hours\x1b[0m $ sf nodes create node-1 --zone hayesvalley --reserved --start "+1h" --duration 6h -p 11.25 diff --git a/src/lib/nodes/extend.ts b/src/lib/nodes/extend.ts index 4d6d5be..f67d9ae 100644 --- a/src/lib/nodes/extend.ts +++ b/src/lib/nodes/extend.ts @@ -37,7 +37,7 @@ Examples:\n $ sf nodes extend my-node --duration 1h --max-price 15.00 \x1b[2m# Extend multiple nodes by node ID instead of name\x1b[0m - $ sf nodes extend node-abc123 node-abc124 node-abc125 --duration 2h --max-price 10.00 + $ sf nodes extend n_b1dc52505c6db142 n_c1ed52505c6db142 --duration 2h --max-price 10.00 \x1b[2m# Extend with raw seconds\x1b[0m $ sf nodes extend my-node --duration 7200 --max-price 10.00 diff --git a/src/lib/nodes/utils.ts b/src/lib/nodes/utils.ts index 7e1e974..0d47276 100644 --- a/src/lib/nodes/utils.ts +++ b/src/lib/nodes/utils.ts @@ -261,7 +261,7 @@ export const yesOption = new Option( */ export const zoneOption = new Option( "-z, --zone ", - "Zone to create the nodes in", + "[Required] Zone for your nodes", ).makeOptionMandatory(); /** @@ -269,7 +269,7 @@ export const zoneOption = new Option( */ export const maxPriceOption = new Option( "-p, --max-price ", - "Maximum price per node hour in dollars", + "[Required] Maximum price per node hour in dollars", ).argParser(validatePrice).makeOptionMandatory(); /** @@ -277,7 +277,7 @@ export const maxPriceOption = new Option( */ export const startOrNowOption = new Option( "-s, --start ", - "Start time (ISO 8601 format or relative time like '+1d', or 'NOW')", + "Start time (ISO 8601 format:'2022-10-27T14:30:00Z' or relative time like '+1d', or 'NOW')", ).argParser(parseStartDateOrNow).default("NOW" as const); /** @@ -285,7 +285,7 @@ export const startOrNowOption = new Option( */ export const endOption = new Option( "-e, --end ", - "End time (ISO 8601 format or relative time like '+1d', rounded up to nearest hour)", + "End time (ISO 8601 format:'2022-10-27T14:30:00Z' or relative time like '+1d', rounded up to nearest hour)", ).argParser(parseEnd); /** @@ -301,5 +301,5 @@ export const durationOption = new Option( */ export const requiredDurationOption = new Option( "-d, --duration ", - "Duration (e.g., '1h', '30m', '2d', 3600) - rounded up to the nearest hour", + "[Required] Duration (e.g., '1h', '30m', '2d', 3600) - rounded up to the nearest hour", ).argParser(parseDurationArgument).makeOptionMandatory();