Skip to content

Commit

Permalink
Remove $ symbol from some commands (#5979)
Browse files Browse the repository at this point in the history
* Remove $ symbol from some commands

<!--
Thank you for opening a PR! Here are some things you need to know before submitting:

1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Dev:-odo-Dev-Guidelines
2. Label this PR accordingly with the '/kind' line
3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Dev:-Writing-and-running-tests
4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/Pull-Requests:-Review-guideline

Documentation:

If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Documentation:-Contributing
-->

**What type of PR is this:**

<!--
Add one of the following kinds:
/kind bug
/kind feature
/kind cleanup
/kind tests

Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well.
-->
/kind documentation

**What does this PR do / why we need it:**

This PR does the following:
* Removes all `$` from commands that should be "copied-and-pasted"
* Separates all console output to a separation section.

Notes:
* "Details" markdown feature would of been used, but Docusaurus does not
  support <details> within a <tab>.

**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->

Fixes #5844

**PR acceptance criteria:**

- [X] Documentation

**How to test changes / Special notes to the reviewer:**

Signed-off-by: Charlie Drage <[email protected]>

* fix based on review
  • Loading branch information
cdrage authored Aug 3, 2022
1 parent 4c266a6 commit 0a89798
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 74 deletions.
8 changes: 2 additions & 6 deletions docs/website/docs/command-reference/create-namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ To create a namespace you can run `odo create namespace <name>`:
```shell
odo create namespace mynamespace
```

Example -
```shell
odo create namespace mynamespace
$ odo create namespace mynamespace
✓ Namespace "mynamespace" is ready for use
✓ New namespace created and now using namespace: mynamespace
```
Expand All @@ -24,10 +22,8 @@ To create a project you can run `odo create project <name>`:
```shell
odo create project myproject
```

Example -
```shell
odo create project myproject
$ odo create project myproject
✓ Project "myproject" is ready for use
✓ New project created and now using project: myproject
```
Expand Down
8 changes: 2 additions & 6 deletions docs/website/docs/command-reference/delete-namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ To delete a namespace you can run `odo delete namespace <name>`:
```shell
odo delete namespace mynamespace
```

Example:
```shell
odo delete namespace mynamespace
$ odo delete namespace mynamespace
✓ Namespace "mynamespace" deleted
```

Expand All @@ -21,10 +19,8 @@ To delete a project you can run `odo delete project <name>`:
```shell
odo delete project myproject
```

Example:
```shell
odo delete project myproject
$ odo delete project myproject
✓ Project "myproject" deleted
```

Expand Down
12 changes: 9 additions & 3 deletions docs/website/docs/command-reference/describe-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ For each of these resources, the following information is displayed:

When the service binding are not deployed yet to the cluster:

```shell
```console
odo describe binding
```
```console
$ odo describe binding
ServiceBinding used by the current component:

Expand All @@ -60,7 +63,10 @@ Start "odo dev" first to see binding information.

When the resources have been deployed to the cluster, the command also extracts information from the status of the resources to display information about the variables that can be used from the component.

```shell
```console
odo describe binding
```
```console
$ odo describe binding
ServiceBinding used by the current component:

Expand Down Expand Up @@ -98,7 +104,7 @@ Available binding information:

### Describe without access to Devfile

```shell
```console
odo describe binding --name <component_name>
```

Expand Down
21 changes: 15 additions & 6 deletions docs/website/docs/command-reference/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ If you haven't already done so, you must [initialize](../command-reference/init)

Afterwards, run `odo dev`:

```sh
```console
odo dev
```
```console
$ odo dev
__
/ \__ Developing using the my-nodejs-app Devfile
Expand Down Expand Up @@ -73,7 +76,10 @@ For example, given the following excerpt from a Devfile:
- running `odo dev` will build the application using the default `my-build` command.
- running `odo dev --build-command my-build-with-version` will build the application using the `my-build-with-version` command:
```shell
```console
odo dev --build-command my-build-with-version
```
```console
$ odo dev --build-command my-build-with-version
__
Expand Down Expand Up @@ -126,7 +132,10 @@ For example, given the following excerpt from a Devfile:
- running `odo dev` will run the default `my-run` command
- running `odo dev --run-command my-run-with-postgres` will run the `my-run-with-postgres` command:
```shell
```console
odo dev --run-command my-run-with-postgres
```
```console
$ odo dev --run-command my-run-with-postgres
__
Expand Down Expand Up @@ -177,7 +186,7 @@ This command will override the `USER` Devfile variable with the value of the `US
It will also override the value of the `DEBUG` Devfile variable with the `true` value.

```shell
$ odo dev --var USER --var DEBUG=true
odo dev --var USER --var DEBUG=true
```

If you create a file `config.vars` containing:
Expand All @@ -190,14 +199,14 @@ DEBUG=true
The following command will have the same behaviour as the previous one:

```shell
$ odo dev --var-file config.vars
odo dev --var-file config.vars
```

The following command will override the `USER` Devfile variable with the `john` value:


```shell
$ odo dev --var USER=john --var-file config.vars
odo dev --var USER=john --var-file config.vars
```

## Devfile (Advanced Usage)
Expand Down
12 changes: 12 additions & 0 deletions docs/website/docs/command-reference/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ The required `--name` flag indicates how the component initialized by this comma

### Interactive mode

```console
odo init
```
```console
$ odo init
? Select language: java
? Select project type: Maven Java (java-maven, registry: DefaultDevfileRegistry)
Expand All @@ -52,7 +55,10 @@ To deploy your component to a cluster use "odo deploy".

In this example, the devfile will be downloaded from the **Staging** registry, which is the first one in the list containing the `nodejs-react` devfile.

```console
odo preference view
```
```console
$ odo preference view
Preference parameters:
PARAMETER VALUE
Expand Down Expand Up @@ -82,7 +88,10 @@ To deploy your component to a cluster use "odo deploy".

In this example, the devfile will be downloaded from the **DefaultDevfileRegistry** registry, as explicitly indicated by the `--devfile-registry` flag.

```console
odo preference view
```
```console
$ odo preference view
Preference parameters:
PARAMETER VALUE
Expand Down Expand Up @@ -110,7 +119,10 @@ To deploy your component to a cluster use "odo deploy".

### Non-interactive mode from a URL

```console
odo init --devfile-path https://registry.devfile.io/devfiles/nodejs-angular --name my-nodejs-app --starter nodejs-angular-starter
```
```console
$ odo init --devfile-path https://registry.devfile.io/devfiles/nodejs-angular --name my-nodejs-app --starter nodejs-angular-starter
✓ Downloading devfile from "https://registry.devfile.io/devfiles/nodejs-angular" [415ms]
✓ Downloading starter project "nodejs-angular-starter" [484ms]
Expand Down
76 changes: 60 additions & 16 deletions docs/website/docs/command-reference/json-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,37 @@ from the devfiles in the registries defined in the list of preferred registries
The output of this command contains a list of devfile name and registry name:

```bash
$ odo analyze -o json
odo analyze -o json
```
```json
[
{
"devfile": "nodejs",
"devfileRegistry": "DefaultDevfileRegistry"
}
]
$ echo $?
```
```console
echo $?
```
```console
0
```

If the command is executed in an empty directory, it will return an error in the standard error stream and terminate with a non-zero exit status:

```bash
$ odo analyze -o json
odo analyze -o json
```
```json
{
"message": "No valid devfile found for project in /home/user/my/empty/directory"
}
$ echo $?
```
```console
echo $?
```
```console
1
```

Expand All @@ -58,6 +70,8 @@ $ odo init -o json \
--name aname \
--devfile go \
--starter go-starter
```
```json
{
"devfilePath": "/home/user/my-project/devfile.yaml",
"devfileData": {
Expand All @@ -75,7 +89,11 @@ $ odo init -o json \
"runningIn": [],
"managedBy": "odo"
}
$ echo $?
```
```console
echo $?
```
```console
0
```

Expand All @@ -87,10 +105,16 @@ $ odo init -o json \
--name aname \
--devfile go \
--starter go-starter
```
```json
{
"message": "a devfile already exists in the current directory"
}
$ echo $?
```
```console
echo $?
```
```console
1
```

Expand All @@ -109,7 +133,9 @@ When the `describe component` command is executed without parameter from a direc
- the modes in which the component is deployed (either none, Dev, Deploy or both)

```bash
$ odo describe component -o json
odo describe component -o json
```
```json
{
"devfilePath": "/home/phmartin/Documents/tests/tmp/devfile.yaml",
"devfileData": {
Expand Down Expand Up @@ -146,7 +172,9 @@ The command with name and namespace will never return information about the Devf
The command with name and namespace will never return information about the forwarded ports, as the information resides in the directory of the Devfile.

```bash
$ odo describe component --name aname -o json
odo describe component --name aname -o json
```
```json
{
"runningIn": ["Dev"],
"managedBy": "odo"
Expand All @@ -164,7 +192,9 @@ The `componentInDevfile` field gives the name of the component present in the `c
In this example, the `component2` component is running in Deploy mode, and the command has been executed from a directory containing a Devfile defining a `component1` component, not running.

```bash
$ odo list --namespace project1
odo list --namespace project1
```
```json
{
"componentInDevfile": "component1",
"components": [
Expand Down Expand Up @@ -193,7 +223,9 @@ The `odo registry` command lists all the Devfile stacks from Devfile registries.
The default output will return information found into the registry index for stacks:

```shell
$ odo registry -o json
odo registry -o json
```
```json
[
{
"name": "python-django",
Expand Down Expand Up @@ -222,7 +254,9 @@ $ odo registry -o json
Using the `--details` flag, you will also get information about the Devfile:

```shell
$ odo registry --details -o json
odo registry --details -o json
```
```json
[
{
"name": "python-django",
Expand Down Expand Up @@ -275,7 +309,9 @@ the component in the `status.bindingFiles` and/or `status.bindingEnvVars` fields
When a service binding resource is defined in the Devfile, and the component is not deployed, you get an output similar to:

```shell
$ odo list binding -o json
odo list binding -o json
```
```json
{
"bindingsInDevfile": [
"my-nodejs-app-cluster-sample"
Expand Down Expand Up @@ -308,7 +344,9 @@ With the same Devfile, when `odo dev` is running, you get an output similar to


```shell
$ odo list binding -o json
odo list binding -o json
```
```json
{
"bindingsInDevfile": [
"my-nodejs-app-cluster-sample"
Expand Down Expand Up @@ -361,7 +399,9 @@ you get an output similar to (note that the `.bindingsInDevfile` field is not pr


```shell
$ odo list binding -o json
odo list binding -o json
```
```json
{
"bindings": [
{
Expand Down Expand Up @@ -419,7 +459,9 @@ information from the deployed resource with the given name.
Without a name, the output of the command is a list of service binding details, for example:

```shell
$ odo describe binding -o json
odo describe binding -o json
```
```json
[
{
"name": "my-first-binding",
Expand Down Expand Up @@ -497,7 +539,9 @@ $ odo describe binding -o json
When specifying a name, the output is a unique service binding:

```shell
$ odo describe binding --name my-first-binding -o json
odo describe binding --name my-first-binding -o json
```
```json
{
"name": "my-first-binding",
"spec": {
Expand Down
7 changes: 2 additions & 5 deletions docs/website/docs/command-reference/list-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ To get more information about a specific service binding, you can run the comman
## Running the Command

To list all the service bindings, you can run `odo list binding`:
```shell
```console
odo list binding
```

Example:

```sh
```console
$ odo list binding
NAME APPLICATION SERVICES RUNNING IN
binding-to-redis my-nodejs-app-app (Deployment) redis (Service) Dev
Expand Down
Loading

0 comments on commit 0a89798

Please sign in to comment.