]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/network
Add bash-completion for the network command
[people/ms/network.git] / src / network
index 80ddae0dfe1976a498a7d66c70d87f3d16c14860..ebd1b5c2912ac3dd922a14340c26ba03dc42eb8b 100644 (file)
@@ -1244,6 +1244,42 @@ function cli_dns_server() {
        exit ${EXIT_OK}
 }
 
+function cli_raw() {
+       local cmd="${1}"
+       assert isset cmd
+       shift
+
+       case "${cmd}" in
+               list-devices)
+                       device_list
+                       ;;
+               list-free-ports)
+                       port_list_free
+                       ;;
+               list-hooks)
+                       hook_list $@
+                       ;;
+               list-ports)
+                       port_list
+                       ;;
+               list-ports-of-zone)
+                       zone_get_ports $@
+                       ;;
+               list-settings)
+                       network_settings_list
+                       ;;
+               list-zones)
+                       zones_get_all
+                       ;;
+               *)
+                       error "No such command: ${cmd}"
+                       exit ${EXIT_ERROR}
+                       ;;
+       esac
+
+       exit ${EXIT_OK}
+}
+
 # Process the given action
 case "${action}" in
        init)
@@ -1268,6 +1304,10 @@ case "${action}" in
                cli_help $@
                ;;
 
+       raw)
+               cli_raw $@
+               ;;
+
        *)
                error "Invalid command given: ${action}"
                cli_usage "network help"