Skip to content

Commit

Permalink
docs: add status --diff to the docs
Browse files Browse the repository at this point in the history
Update the manpage and autocomplete files.
  • Loading branch information
daniloegea committed Feb 28, 2024
1 parent a1f2e04 commit 7312392
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions doc/netplan-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ Currently, **`netplan status`** depends on `systemd-networkd` as a source of dat
`-a`, `--all`
: Show all interface data including inactive.

`--diff`
: Analyze and display differences between the current system configuration and network definitions present in the YAML files.
The configuration analyzed includes IP addresses, routes, MAC addresses, DNS addresses, search domains and missing network interfaces.

The output format is similar to popular diff tools, such `diff` and `git diff`. Configuration present only in the system (and therefore missing in the Netplan YAMLs)
will be displayed with a `+` sign and will be highlighted in green. Configuration present only in Netplan (and therefore missing in the system) will be displayed
with a `-` sign and highlighted in red. The same is applied to network interfaces.

`--diff-only`
: Same as `--diff` but omits all the information that is not a difference.

`--root-dir`
: Read YAML files from this root instead of `/`.

`--verbose`
: Show extra information.

`-f` *`FORMAT`*, `--format` *`FORMAT`*
: Output in machine-readable `json` or `yaml` format.

Expand Down
2 changes: 1 addition & 1 deletion netplan.completions
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _netplan_completions() {
;;

'status'*)
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_netplan_completions_filter "-h --help --debug -a --all -f --format $(ls /sys/class/net 2> /dev/null)")" -- "$cur" )
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_netplan_completions_filter "-h --help --debug -a --all --diff --diff-only --root-dir --verbose -f --format $(ls /sys/class/net 2> /dev/null)")" -- "$cur" )
;;

'apply'*)
Expand Down
4 changes: 4 additions & 0 deletions tools/completely.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ netplan status:
- --debug
- -a
- --all
- --diff
- --diff-only
- --root-dir
- --verbose
- -f
- --format
- $(ls /sys/class/net 2> /dev/null)
Expand Down

0 comments on commit 7312392

Please sign in to comment.