Railway CLI version
5.28.1
What happened
I hit this while scripting a scale change with explicit project, environment, and service selectors:
railway scale \
--project <PROJECT_ID> \
--environment <ENVIRONMENT> \
--service <SERVICE_ID> \
us-west=0 \
--json
The command fails with:
Invalid replica count `<PROJECT_ID>` in `project=<PROJECT_ID>`
Caused by:
invalid digit found in string
Using the short project option works:
railway scale \
-p <PROJECT_ID> \
-e <ENVIRONMENT> \
-s <SERVICE_ID> \
us-west=0 \
--json
Expected behavior
--project <PROJECT_ID> should behave the same as -p <PROJECT_ID>.
Possible cause
I took a quick look at src/commands/scale.rs. The legacy scale argument normalizer recognizes service and environment as long options that take values, but not project:
|
fn scale_long_flag_takes_value(flag: &str) -> bool { |
|
matches!(flag, "service" | "environment") |
|
} |
|
|
|
fn scale_long_flag_is_known(flag: &str) -> bool { |
|
matches!(flag, "json" | "help" | "version") || scale_long_flag_takes_value(flag) |
|
} |
That appears to cause --project <ID> to be normalized into the positional assignment project=<ID> before Clap parses it.
--project was added to scale in #893, shortly after the scale argument normalizer was introduced in #881.
The current workaround is to use -p.
Railway CLI version
5.28.1
What happened
I hit this while scripting a scale change with explicit project, environment, and service selectors:
The command fails with:
Using the short project option works:
Expected behavior
--project <PROJECT_ID>should behave the same as-p <PROJECT_ID>.Possible cause
I took a quick look at
src/commands/scale.rs. The legacy scale argument normalizer recognizesserviceandenvironmentas long options that take values, but notproject:cli/src/commands/scale.rs
Lines 383 to 389 in 4d49d98
That appears to cause
--project <ID>to be normalized into the positional assignmentproject=<ID>before Clap parses it.--projectwas added to scale in #893, shortly after the scale argument normalizer was introduced in #881.The current workaround is to use
-p.