Skip to content

Commit

Permalink
Remove command prompt from Windows example (#18906)
Browse files Browse the repository at this point in the history
* Remove command prompt from Windows example

According to the [style
guide](https://kubernetes.io/docs/contribute/style/style-guide/#don-t-include-the-command-prompt),
the command prompt should not be included in the examples. Removing the
Windows command prompt from the jsonpath example.

Signed-off-by: Mariyan Dimitrov <mariyan.dimitrov@gmail.com>

* Put Windows example inside note shortcode

I'm putting the Windows example in a Hug note shortcode to be consistent
with the rest of the documentation.

Signed-off-by: Mariyan Dimitrov <mariyan.dimitrov@gmail.com>
  • Loading branch information
merkata committed Feb 9, 2020
1 parent 456d277 commit 3482077
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions content/en/docs/reference/kubectl/jsonpath.md
Expand Up @@ -89,11 +89,13 @@ kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'status.capacity']}"
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'
```

{{< note >}}
On Windows, you must _double_ quote any JSONPath template that contains spaces (not single quote as shown above for bash). This in turn means that you must use a single quote or escaped double quote around any literals in the template. For example:

```cmd
C:\> kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.status.startTime}{'\n'}{end}"
C:\> kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.startTime}{\"\n\"}{end}"
kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.status.startTime}{'\n'}{end}"
kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.startTime}{\"\n\"}{end}"
```
{{< /note >}}

{{% /capture %}}

0 comments on commit 3482077

Please sign in to comment.