[lxc-devel] [lxc/master] Add bash completion to list backing store types for lxc-create -B

abbasally5 on Github lxc-bot at linuxcontainers.org
Sun Dec 3 05:59:29 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 444 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20171203/b8975711/attachment.bin>
-------------- next part --------------
From caba109477060d96abf289122540295de7e51102 Mon Sep 17 00:00:00 2001
From: Abbas Ally <abbasally5 at yahoo.com>
Date: Sun, 3 Dec 2017 05:51:44 +0000
Subject: [PATCH] Add bash completion to list backing store types for
 lxc-create -B - Backing Store types are hard-coded (Not sure how to get
 programmatically) - Closes #1236

Signed-off-by: Abbas Ally <abbasally5 at yahoo.com>
---
 config/bash/lxc.in | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/config/bash/lxc.in b/config/bash/lxc.in
index 7dcf3022b..72d5f0817 100644
--- a/config/bash/lxc.in
+++ b/config/bash/lxc.in
@@ -11,6 +11,10 @@ _have lxc-start && {
         COMPREPLY=( $( compgen -W "$(ls @LXCTEMPLATEDIR@/ | sed -e 's|^lxc-||' )" "$cur" ) )
     }
 
+    _lxc_backing_stores() {
+        COMPREPLY=( $( compgen -W "dir lvm loop btrfs zfs rbd best" "$cur" ) )
+    }
+
     _lxc_generic_n() {
         local cur prev
 
@@ -59,6 +63,11 @@ _have lxc-start && {
                 _lxc_templates "$cur"
                 return 0
             ;;
+
+            -B)
+                _lxc_backing_stores "$cur"
+                return 0
+            ;;
         esac
 
         return 1


More information about the lxc-devel mailing list