]> git.ipfire.org Git - people/ms/network.git/commitdiff
autocompletion: use hids instead of ids
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Wed, 26 Jul 2017 08:44:44 +0000 (10:44 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 27 Jul 2017 09:54:52 +0000 (11:54 +0200)
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/bash-completion/network

index 820c2d41929f6c86bf6f0d356050e7b6ce858573..34d3f2f814897cf02b3f1a0b9ad52f7d021b8002 100644 (file)
@@ -421,7 +421,7 @@ _network_zone_subcommand_config() {
 
        local words=( $@ )
 
-       local commands="destroy list new $(network raw list-zone-config-ids ${zone})"
+       local commands="destroy list new $(network raw list-zone-config-hids ${zone})"
 
        local cmd="$(_network_find_on_cmdline "${commands}")"
        if [[ -z "${cmd}" ]]; then
@@ -437,12 +437,8 @@ _network_zone_subcommand_config() {
                destroy)
                        _network_zone_subcommand_config_destroy ${zone} ${args}
                        ;;
-               # We use no better globbing like [:digit:] here because hids would not match the glob
-               # Also bash is silly here and does not unterstand things like ^[[:digit:]]+$ here.
                *)
-                       # Check if we get a valid id
-                       # TODO: We should also accept a valid hid
-                       if network raw zone-config-id-is-valid ${zone} ${cmd}; then
+                       if network raw zone-config-id-is-valid ${zone} ${cmd} || network raw zone-config-hid-is-valid ${zone} ${cmd}; then
                                _network_zone_subcommand_config_subcommand ${zone} ${args}
                        fi
                        ;;