Commit 7c96465
feat: accept pool name as positional arg in browser-pools create (#110)
## Summary
Allow `kernel browser-pools create my-pool` as shorthand for `kernel
browser-pools create --name my-pool`. The `--name` flag still works for
backward compatibility. added this because I forget to add `--name`
## Testing
Previously we created the pool and ignored the passed name
```
❯ kernel browser-pools create test --size 1
SUCCESS Created browser pool a8e4g5n4doawmwwy7dip8qqz
```
Now we are creating the pool and the name is set. `--name` still works
```
❯ ./bin/kernel browser-pools create test --size 1
SUCCESS Created browser pool test (pctp2h92siimy4jxks89g33g)
❯ ./bin/kernel browser-pools create --name test --size 1
ERROR Conflict: A pool with this name already exists
```
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Small CLI parsing change limited to `browser-pools create`; low blast
radius aside from potential behavior change when both `--name` and a
positional name are supplied.
>
> **Overview**
> `kernel browser-pools create` now accepts an optional positional
`[name]` argument as a shorthand for `--name`.
>
> The command enforces mutual exclusivity between the positional name
and `--name` (returns an error if both are provided) and updates the
Cobra command usage/arg validation accordingly.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
46881b1. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent afd1bfe commit 7c96465
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
| 409 | + | |
409 | 410 | | |
410 | 411 | | |
411 | 412 | | |
| |||
518 | 519 | | |
519 | 520 | | |
520 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
521 | 528 | | |
522 | 529 | | |
523 | 530 | | |
| |||
0 commit comments