Tweak run-external signature so command must be a string (#8971)

Tiny fix: clarify in `run-external`'s signature that the external
command must be a string.

### Before
```
Signatures:
  <any> | run-external <any> -> <any>

Parameters:
  command <any>: external command to run
  ...args <any>: arguments for external command
```

### After
```
Signatures:
  <any> | run-external <string> -> <any>

Parameters:
  command <string>: external command to run
  ...args <any>: arguments for external command
```


### Notes

I was hoping to change more `any`s to more specific types, but alas I
think we can only change `command` right now. The input can be any type
and it gets rendered to a string before being passed to the external.
The args can be any value type and they get converted to strings. The
output can be either binary or a string.
This commit is contained in:
Reilly Wood 2023-04-22 10:57:16 -07:00 committed by GitHub
parent 0cc735a7b2
commit 7413ef2824
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ impl Command for External {
.switch("redirect-stdout", "redirect stdout to the pipeline", None)
.switch("redirect-stderr", "redirect stderr to the pipeline", None)
.switch("trim-end-newline", "trimming end newlines", None)
.required("command", SyntaxShape::Any, "external command to run")
.required("command", SyntaxShape::String, "external command to run")
.rest("args", SyntaxShape::Any, "arguments for external command")
.category(Category::System)
}