[5/6] network: add color commands

Submitted by Jonatan Schlag on June 9, 2017, 10:17 a.m.

Details

Message ID 1497003452-10190-5-git-send-email-jonatan.schlag@ipfire.org
State New
Headers show

Commit Message

Jonatan Schlag June 9, 2017, 10:17 a.m.
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
---
 src/network | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/network b/src/network
index e0d57a0..1bccdea 100644
--- a/src/network
+++ b/src/network
@@ -518,6 +518,9 @@  cli_port() {
 			edit|create|remove|up|down|status|identify)
 				port_${action} "${port}" $@
 				;;
+			color)
+				color_cli "port" "${port}" $@
+			;;
 			*)
 				error "Unrecognized argument: ${action}"
 				exit ${EXIT_ERROR}
@@ -576,6 +579,9 @@  cli_zone() {
 			config|disable|down|edit|enable|identify|status|up)
 				zone_${action} ${zone} $@
 				;;
+			color)
+				color_cli "zone" "${zone}" $@
+				;;
 			*)
 				error "Unrecognized argument: ${action}"
 				cli_show_man network-zone

Comments

Michael Tremer June 14, 2017, 9:10 p.m.
Hi,

On Fri, 2017-06-09 at 12:17 +0200, Jonatan Schlag wrote:
> Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
> ---
>  src/network | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/network b/src/network
> index e0d57a0..1bccdea 100644
> --- a/src/network
> +++ b/src/network
> @@ -518,6 +518,9 @@ cli_port() {
>  			edit|create|remove|up|down|status|identify)
>  				port_${action} "${port}" $@
>  				;;
> +			color)
> +				color_cli "port" "${port}" $@
> +			;;
>  			*)
>  				error "Unrecognized argument:
> ${action}"
>  				exit ${EXIT_ERROR}

Indentation of ;; is incorrect.

> @@ -576,6 +579,9 @@ cli_zone() {
>  			config|disable|down|edit|enable|identify|sta
> tus|up)
>  				zone_${action} ${zone} $@
>  				;;
> +			color)
> +				color_cli "zone" "${zone}" $@
> +				;;
>  			*)
>  				error "Unrecognized argument:
> ${action}"
>  				cli_show_man network-zone

Apart from that this is really elegantly solved ;)

-Michael