Summary
--input-file - is rejected with file not found: - instead of being read from stdin. The - filename convention for stdin is broadly expected across Unix tools (curl --data-binary @-, kubectl apply -f -, jq, cat, etc.), and works around the lack of body-field flags on commands like cloud serverless projects search create (filed separately as #328).
--input-file is on most mutating commands and all the helpers (es bulk, es search, es helpers bulk-ingest, es helpers scroll-search, kb saved-objects post-saved-objects-import, cloud serverless projects search create, ...), so this affects a wide surface.
Reproducer
$ elastic version
{"version": "0.1.1"}
$ echo '{"name":"x","region_id":"aws-us-east-1"}' \
| elastic cloud serverless projects search create --input-file - --dry-run
Error: --input-file: file not found: -
Usage: elastic cloud serverless projects search create [options]
...
Process substitution works as a current workaround:
$ elastic cloud serverless projects search create \
--input-file <(echo '{"name":"x","region_id":"aws-us-east-1"}') --dry-run
dry run: inputs valid, no action performed
But that's bash/zsh-specific and unfamiliar to many users; the - convention is what most reach for first.
Expected behavior
When --input-file - is supplied, read the body from stdin until EOF. This matches the convention used by curl, kubectl, jq, pass, and most other Unix tools that take --input-file / -f / --data.
Applying the change once in the shared input-file resolver should make every command that accepts --input-file benefit, without per-command work.
Environment
Summary
--input-file -is rejected withfile not found: -instead of being read from stdin. The-filename convention for stdin is broadly expected across Unix tools (curl --data-binary @-,kubectl apply -f -,jq,cat, etc.), and works around the lack of body-field flags on commands likecloud serverless projects search create(filed separately as #328).--input-fileis on most mutating commands and all the helpers (es bulk,es search,es helpers bulk-ingest,es helpers scroll-search,kb saved-objects post-saved-objects-import,cloud serverless projects search create, ...), so this affects a wide surface.Reproducer
Process substitution works as a current workaround:
But that's bash/zsh-specific and unfamiliar to many users; the
-convention is what most reach for first.Expected behavior
When
--input-file -is supplied, read the body from stdin until EOF. This matches the convention used bycurl,kubectl,jq,pass, and most other Unix tools that take--input-file/-f/--data.Applying the change once in the shared input-file resolver should make every command that accepts
--input-filebenefit, without per-command work.Environment
elasticv0.1.1 on macOS