Skip to content

Commit 5a339e4

Browse files
committed
doc: clarify sections and use "home styled" admonitions
Files in doc/cli/*.md are used in and displayed as help text in the CLI admin-exec level. So we cannot use standard admonitions (yet) since the terminal markdown converter (lowdown) doesn't support the syntax. Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 90ec35c commit 5a339e4

File tree

6 files changed

+65
-25
lines changed

6 files changed

+65
-25
lines changed

doc/cli/configure.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ admin@host:/config/interface/eth0/> up
4040
admin@host:/config/>
4141
```
4242

43-
> **Note:** the tree structure in the configure context is automatically
44-
> generated from the system's supported NETCONF YANG models, which may
45-
> vary between products. However, the `ietf-interfaces.yang` and
46-
> `ietf-ip.yang` models, for instance, that provide basic networking
43+
----
44+
45+
> **Note:** commands in configure context are automatically generated
46+
> from the system's YANG models, hence different products likely have a
47+
> different set of commands. However, both the `ietf-interfaces.yang`
48+
> and `ietf-ip.yang` models, for instance, that provide the networking
4749
> support are common to all systems.
4850
51+
----
4952

5053
## Set IP Address on an Interface
5154

@@ -103,9 +106,12 @@ admin@host:/> copy running-config startup-config
103106
The `startup-config` can also be inspected with the `show` command to
104107
verify the changes are saved.
105108

106-
> **Note:** most (all) commands need to be spelled out, no short forms
107-
> are allowed at the moment. Use the `TAB` key to make this easier.
109+
----
110+
111+
> **Note:** all commands need to be spelled out, no short forms are
112+
> allowed in the CLI. Use the `TAB` key to make your life easier.
108113
114+
----
109115

110116
## Changing Hostname
111117

@@ -122,9 +128,12 @@ admin@example:/>
122128
Notice how the hostname in the prompt does not change until the change
123129
is committed.
124130

131+
----
132+
125133
> **Note:** critical services like syslog, mDNS, LLDP, and similar that
126134
> advertise the hostname, are restarted when the hostname is changed.
127135
136+
----
128137

129138
## Changing Password
130139

@@ -148,10 +157,13 @@ the `do password encrypt` command. This launches the admin-exec command
148157
to hash, and optionally salt, your password. This encrypted string can
149158
then be used with `set password ...`.
150159

160+
----
161+
151162
> **Tip:** if you are having trouble thinking of a password, there is
152163
> also `do password generate`, which generates random but readable
153164
> strings using the UNIX command `pwgen`.
154165
166+
----
155167

156168
## SSH Authorized Key
157169

@@ -173,10 +185,14 @@ key-data AAAAB3NzaC1yc2EAAAADAQABAAABgQC8iBL42yeMBioFay7lty1C4ZDTHcHyo739gc91rTT
173185
admin@host:/config/system/authentication/user/admin/authorized-key/example@host/> leave
174186
```
175187

188+
----
189+
176190
> **Note:** the `ssh-keygen` program already base64 encodes the public
177191
> key data, so there is no need to use the `text-editor` command, `set`
178192
> does the job.
179193
194+
----
195+
180196
## Creating a VETH Pair
181197

182198
The following example creates a `veth0a <--> veth0b` virtual Ethernet
@@ -213,10 +229,13 @@ admin@host:/config/> leave
213229

214230
See the bridging example below for more.
215231

232+
----
233+
216234
> **Note:** in the CLI you do not have to create the `veth0b` interface.
217235
> The system _infers_ this for you. When setting up a VETH pair using
218236
> NETCONF, however, you must include the `veth0b` interface.
219237
238+
----
220239

221240
## Creating a Bridge
222241

@@ -272,6 +291,10 @@ the VETH pair from the previous example) are now bridged. Any traffic
272291
ingressing one port will egress the other. Only reserved IEEE multicast
273292
is filtered, except LLDP frames as shown above.
274293

294+
----
295+
275296
> **Note:** the bridge can be named anything, provided the interface
276297
> name is not already taken. However, for any name outside the pattern
277298
> `br[0-9]+`, you have to set the interface type manually to `bridge`.
299+
300+
----

doc/cli/introduction.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Introduction
1+
# CLI Introduction
22

33
The command line interface (CLI, see-ell-aye) implements a CISCO-like,
44
or Juniper Networks JunOS-like, CLI. It is the traditional way of
@@ -10,8 +10,7 @@ Nevertheless, when it comes to initial deployment and debugging, it
1010
is very useful to know how to navigate and use the CLI. This very
1111
short guide intends to help you with that.
1212

13-
14-
## About
13+
----
1514

1615
New users usually get the CLI as the default "shell" when logging in,
1716
but the default `admin` user logs in to `bash`. To access the CLI,
@@ -35,9 +34,12 @@ admin@host-12-34-56:/> show # Try: Tab or ?
3534
admin@host-12-34-56:/> # Try: Tab or ?
3635
```
3736

38-
> **Tip:** Even on an empty command line you can tap the Tab or ? keys.
39-
> See `help keybindings` for more tips!
37+
----
38+
39+
> **Note:** even on an empty command line, you can tap the `Tab` or `?` keys.
40+
> See [`help keybindings`](keybindings.md) for more tips!
4041
42+
----
4143

4244
## Key Concepts
4345

@@ -132,8 +134,12 @@ In *configure context* the following commands are available:
132134

133135
## Example Session
134136

135-
> Remember to use the `TAB` and `?` keys to speed up your navigation.
136-
> See `help keybindings` for more tips!
137+
----
138+
139+
> Remember to use the `TAB` and `?` keys to speed up your navigation.
140+
> See [`help keybindings`](keybindings.md) for more tips!
141+
142+
----
137143

138144
In this example we enter configure context to add an IPv4 address to
139145
interface `eth0`, then we apply the changes using the `leave` command.
@@ -181,4 +187,3 @@ admin@host-12-34-56:/> copy startup-config running-config
181187
```
182188

183189
Or restarting the device.
184-

doc/cli/keybindings.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Keybindings
1+
# CLI Keybindings
22

33
Writing CLI commands by hand is very tedious. To make things easier the
44
CLI has several keybindings, most significant first:
@@ -27,10 +27,12 @@ CLI has several keybindings, most significant first:
2727
| Ctrl-n | Down arrow | History, next command |
2828
| Ctrl-r | | History, reversed interactive search (i-search) |
2929

30-
> **Note:** the Meta key is called Alt on most modern keyboards. If you
31-
> have neither, first tap the Esc key instead of holding down Alt/Meta.
30+
## What is Meta?
3231

33-
## Examples
32+
The Meta key is called Alt on most modern keyboards. If you have
33+
neither, first tap the Esc key instead of holding down Alt/Meta.
34+
35+
## Usage
3436

3537
Complete a word. Start by typing a few characters, then tap the TAB key
3638
on your keyboard:

doc/cli/quick.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Quick Overview
1+
# CLI Quickstart Guide
22

33
The question mark `?` key along with the `Tab` key are your best friends
44
in the command line interface. They provide context help and completion
@@ -16,14 +16,17 @@ of commands you input. See the table below for a handful of examples.
1616
Explore the following topics for more information. Note, the
1717
keybindings are really useful to learn!
1818

19-
| **Command** | **Description** |
20-
|---------------------|--------------------------------------------|
21-
| `help introduction` | An introduction to the CLI |
22-
| `help configure` | How to use configure context |
23-
| `help text-editor` | Help with the built-in text-editor command |
24-
| `help keybindings` | Lists keybindings and other helpful tricks |
19+
| **Command** | **Description** |
20+
|---------------------|----------------------------------------------------|
21+
| `help introduction` | An introduction to the CLI |
22+
| `help configure` | How to use configure context |
23+
| `help text-editor` | Help with the built-in text-editor command |
24+
| `help keybindings` | Lists available keybindings & other helpful tricks |
25+
26+
----
2527

2628
> In `configure` context the `help setting` command shows the YANG
2729
> description text for each node and container. To reach the admin
2830
> exec help from configure context, e.g., `do help text-editor`
2931
32+
----

doc/cli/tcpdump.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,15 @@ up the switch core to mirror traffic ingressing and/or egressing a set
5757
of ports to another port. On this *monitor port* you can then run your
5858
tcpdump, which means you need an external device (laptop).
5959

60+
----
61+
6062
> A planned feature is to support mirroring traffic to the CPU port,
6163
> which would be an effective way to log and monitor traffic over a
6264
> longer period of time. Highly effective for diagnosing intermittent
6365
> and other rare network issues.
6466
67+
----
68+
6569
If only "proof of life" is required, then sometimes port counters, also
6670
called *RMON counters*, can be very useful too. Seeing counters of a
6771
particular type increment means traffic is ingressing or egressing.

doc/cli/text-editor.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ C-x i insert C-x g goto-ln C-x o other win C-x C-x swap M-q reform
4444
- tap `c`
4545
- release `Ctrl`
4646

47+
----
48+
4749
> The status field at the bottom asks if you are really sure, and/or if
4850
> you want to add a final Enter/newline to the file. For binary content
4951
> that final newline may be important.
5052
53+
----
5154

5255
## Changing the Editor
5356

0 commit comments

Comments
 (0)