From e109ed3922f2a3ff68a77f727ead27f2eb4a82ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Mon, 6 Feb 2017 16:50:07 +0100
Subject: [PATCH] bash completion: Complete file names after 'guix system
 COMMAND'.

* etc/completion/bash/guix (_guix_complete): When the command is
"system" and $COMP_CWORD > 2, use _guix_complete_file.
---
 etc/completion/bash/guix | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 01b0e203942..9c851e37170 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -154,7 +154,10 @@ _guix_complete ()
 		fi
 	    elif _guix_is_command "system"
 	    then
-		_guix_complete_subcommand
+		case $COMP_CWORD in
+		    2) _guix_complete_subcommand;;
+		    *) _guix_complete_file;; # TODO: restrict to *.scm
+		esac
 	    elif _guix_is_command "import"
 	    then
 		_guix_complete_subcommand
-- 
GitLab