diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/completion/bash/guix | 74 | ||||
-rwxr-xr-x | etc/git/pre-push | 4 |
2 files changed, 66 insertions, 12 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index 0333bfc8a2..df35919eb2 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> +# Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> # # This file is part of GNU Guix. # @@ -115,6 +115,24 @@ _guix_is_dash_m () esac } } +_guix_is_dash_C () +{ + [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-C" ] \ + || { case "${COMP_WORDS[$COMP_CWORD]}" in + --channels=*) true;; + *) false;; + esac } +} + +_guix_is_dash_p () +{ + [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-p" ] \ + || { case "${COMP_WORDS[$COMP_CWORD]}" in + --profile=*) true;; + *) false;; + esac } +} + _guix_complete_file () { # Let Readline complete file names. @@ -130,6 +148,17 @@ _guix_complete_pid () declare _guix_subcommands +_guix_complete_subcommand () +{ + if [ -z "$_guix_subcommands" ] + then + # Cache the list of subcommands to speed things up. + _guix_subcommands="$(guix --help 2> /dev/null \ + | grep '^ ' | cut -c 2-)" + fi + COMPREPLY=($(compgen -W "$_guix_subcommands" -- "$word_at_point")) +} + _guix_complete () { local word_count=${#COMP_WORDS[*]} @@ -147,13 +176,7 @@ _guix_complete () case $COMP_CWORD in 1) - if [ -z "$_guix_subcommands" ] - then - # Cache the list of subcommands to speed things up. - _guix_subcommands="$(guix --help 2> /dev/null \ - | grep '^ ' | cut -c 2-)" - fi - COMPREPLY=($(compgen -W "$_guix_subcommands" -- "$word_at_point")) + _guix_complete_subcommand ;; *) if _guix_is_command "package" @@ -169,13 +192,28 @@ _guix_complete () fi elif _guix_is_command "install" then - _guix_complete_available_package "$word_at_point" + if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p + then + _guix_complete_file + else + _guix_complete_available_package "$word_at_point" + fi elif _guix_is_command "remove" then - _guix_complete_installed_package "$word_at_point" + if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p + then + _guix_complete_file + else + _guix_complete_installed_package "$word_at_point" + fi elif _guix_is_command "upgrade" then - _guix_complete_installed_package "$word_at_point" + if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p + then + _guix_complete_file + else + _guix_complete_installed_package "$word_at_point" + fi elif _guix_is_command "build" then if _guix_is_dash_L || _guix_is_dash_m @@ -193,6 +231,20 @@ _guix_complete () 2) _guix_complete_subcommand;; *) _guix_complete_file;; # TODO: restrict to *.scm esac + elif _guix_is_command "pull" + then + if _guix_is_dash_C || _guix_is_dash_p + then + _guix_complete_file + fi + elif _guix_is_command "time-machine" + then + if _guix_is_dash_C + then + _guix_complete_file + else + _guix_complete_subcommand + fi elif _guix_is_command "container" then case $COMP_CWORD in diff --git a/etc/git/pre-push b/etc/git/pre-push index 59294f0ffb..415345fc75 100755 --- a/etc/git/pre-push +++ b/etc/git/pre-push @@ -1,6 +1,8 @@ #!/bin/sh -# A hook script that prevents the user from pushing unsigned commits. +# This hook script prevents the user from pushing to Savannah if any of the new +# commits' OpenPGP signatures cannot be verified, or if a commit is signed +# with an unauthorized key. # Called by "git push" after it has checked the remote status, but before # anything has been pushed. If this script exits with a non-zero status nothing |