Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --show to select command #1953

Merged
merged 1 commit into from
Aug 25, 2023
Merged

Add --show to select command #1953

merged 1 commit into from
Aug 25, 2023

Conversation

mtdowling
Copy link
Member

--show is used to include additional data in select command output, including the shape type, file where the shape is defined, and/or variables captured when the shape was matched.

For example:

smithy select --selector 'structure $neighbors(>)' --show-traits documentation --show type,file,vars --aut s3.json

Outputs:

[
    {
        "shape": "com.amazonaws.s3#CSVInput",
        "type": "structure",
        "file": "/path/to/s3.json:16224:34",
        "vars": {
            "neighbors": [
                "com.amazonaws.s3#CSVInput$AllowQuotedRecordDelimiter",
                "com.amazonaws.s3#CSVInput$Comments",
                "com.amazonaws.s3#CSVInput$FieldDelimiter",
                "com.amazonaws.s3#CSVInput$FileHeaderInfo",
                "com.amazonaws.s3#CSVInput$QuoteCharacter",
                "com.amazonaws.s3#CSVInput$QuoteEscapeCharacter",
                "com.amazonaws.s3#CSVInput$RecordDelimiter"
            ]
        },
        "traits": {
            "smithy.api#documentation": "<p>Describes how an uncompressed comma-separated values (CSV)-formatted input object is formatted.</p>"
        }
    }
]

This now deprecates the --show-vars option, as --show vars should be used instead.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

--show is used to include additional data in select command output,
including the shape type, file where the shape is defined, and/or
variables captured when the shape was matched.

For example:

```
smithy select --selector 'structure $neighbors(>)' --show-traits documentation --show type,file,vars --aut s3.json
```

Outputs:

```
[
    {
        "shape": "com.amazonaws.s3#CSVInput",
        "type": "structure",
        "file": "/path/to/s3.json:16224:34",
        "vars": {
            "neighbors": [
                "com.amazonaws.s3#CSVInput$AllowQuotedRecordDelimiter",
                "com.amazonaws.s3#CSVInput$Comments",
                "com.amazonaws.s3#CSVInput$FieldDelimiter",
                "com.amazonaws.s3#CSVInput$FileHeaderInfo",
                "com.amazonaws.s3#CSVInput$QuoteCharacter",
                "com.amazonaws.s3#CSVInput$QuoteEscapeCharacter",
                "com.amazonaws.s3#CSVInput$RecordDelimiter"
            ]
        },
        "traits": {
            "smithy.api#documentation": "<p>Describes how an uncompressed comma-separated values (CSV)-formatted input object is formatted.</p>"
        }
    }
]
```

This now deprecates the `--show-vars` option, as `--show vars` should
be used instead.
@mtdowling mtdowling requested a review from a team as a code owner August 25, 2023 19:40
@mtdowling mtdowling merged commit afc523d into main Aug 25, 2023
11 checks passed
@mtdowling mtdowling deleted the add-more-data-to-select branch September 11, 2023 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants