From unknown Sat Jun 21 05:08:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63860] [PATCH] Shepherd: Add Bash completion file. Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Jun 2023 22:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63860@debbugs.gnu.org Cc: Oleg Pykhalov X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16857443955211 (code B ref -1); Fri, 02 Jun 2023 22:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Jun 2023 22:19:55 +0000 Received: from localhost ([127.0.0.1]:40957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5D7i-0001Ly-KK for submit@debbugs.gnu.org; Fri, 02 Jun 2023 18:19:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:34136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5D7e-0001Lp-QU for submit@debbugs.gnu.org; Fri, 02 Jun 2023 18:19:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5D7e-00066S-HZ for guix-patches@gnu.org; Fri, 02 Jun 2023 18:19:50 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5D7c-0003nJ-Vk for guix-patches@gnu.org; Fri, 02 Jun 2023 18:19:50 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b035e94072so3515501fa.1 for ; Fri, 02 Jun 2023 15:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685744385; x=1688336385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=A+csw9nnfozvN8oPOSMVRefLXLn2+g9cyxvKIoHgF+U=; b=rTMU/uMpeELyROgS+Q+nNKpN/Q+hvjyyVkL49yj3B796g/WV6R8/bXh+3yBTJbaexf Z/pfshOrfpOxPb18epHZGhqY3WMYOK6zGyL08AYDH2zUhmXDo87Uh66j1yDP8hWHB0ov Ou4pS4jg+sLxx5IG9wRPPxXrEt3tFu40R9iTwsm5/KjrGqGmanJF6VnL4q7a9hgDZZ0s HrF7Q0O3eGJhleEzeBHmx5mSfj0i6Mt4PQ81N+U6fvxE59HhEqXAzWqLveC3FcgmtQuM xxanHgss9M7gZomfYK1FmsjT1Q1+m8xZUN/hlpK4IbOkOEhScTsQU0mOfFuINRDSE4Xn KwIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685744385; x=1688336385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A+csw9nnfozvN8oPOSMVRefLXLn2+g9cyxvKIoHgF+U=; b=eLkDPhpXvX3mrpdbe2i+Tk5RzossmLPPSqTn8h5QjO7P6+R48th16d7qjbsRdpRzO7 K1lEooXYSpX4LExPrYPH+P0K5KdeOWKFBIxOKjJNAGhrbsEPLefF8Pi8/KQ//sqscDOT rxtNsQRTgECkrJQ4ZoXgiFqrjpLBnqcROYLBEr/d40nUIxIENkd1CC8+TJ/sK7BgoM9f //tApQJScDYNV4EiiT1I0gnvuMChyiNhBinTXDk6j9bI3wOXuzlIfszVujKlF64oxmOz JOVwH+qR59i3fjyByV9pX6uzRqZVnqm7wDUxpNctFntVl6QgLAiBmyXkj7oxLhEUujp2 VLCA== X-Gm-Message-State: AC+VfDyJq/H5Y6LHASpiPbXSkVSdKChhiPYnh/fxC9KdR8HYXqE75ARu sWlyp5dl8Town2k/7hW9n83Tw8Zx1AY= X-Google-Smtp-Source: ACHHUZ5WXwJ0aF7VUjmphy7NoR/LfwejIHAKHfxKxqe3kB2DSPfsU91Mdj7qewn8DCYJ7R2v5ddsOQ== X-Received: by 2002:ac2:53b5:0:b0:4f3:ab2d:882d with SMTP id j21-20020ac253b5000000b004f3ab2d882dmr4981498lfh.4.1685744384949; Fri, 02 Jun 2023 15:19:44 -0700 (PDT) Received: from guixsd.wugi.info ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id y12-20020ac2446c000000b004f388c5f25dsm290661lfl.257.2023.06.02.15.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 15:19:44 -0700 (PDT) From: Oleg Pykhalov Date: Sat, 3 Jun 2023 01:19:23 +0300 Message-Id: <20230602221923.16196-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=go.wigust@gmail.com; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This patch adds a Bash completion file discussed in the 45004 issue: awk replaced with grep and sed; added more Guix related subcommands; fixed typo with 't' letter in 'for word in ${COMP_WORDS[*]}t'. Tested with command: guix build -f guix.scm which produced: /gnu/store/hr4rqm9wi9i2fpcd75zpqfd04vqavyif-shepherd-0.10.99-git/etc/bash_completion.d/herd Oleg Pykhalov (1): Add Bash completion file. Makefile.am | 4 ++ configure.ac | 9 ++++ etc/completion/bash/herd | 104 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 etc/completion/bash/herd base-commit: b9b15db9e5bda27287706b6727c462df686e7621 -- 2.38.0 From unknown Sat Jun 21 05:08:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63860] [PATCH] Add Bash completion file. References: <20230602221923.16196-1-go.wigust@gmail.com> In-Reply-To: <20230602221923.16196-1-go.wigust@gmail.com> Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Jun 2023 22:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63860@debbugs.gnu.org Cc: Oleg Pykhalov Received: via spool by 63860-submit@debbugs.gnu.org id=B63860.16857445235468 (code B ref 63860); Fri, 02 Jun 2023 22:23:01 +0000 Received: (at 63860) by debbugs.gnu.org; 2 Jun 2023 22:22:03 +0000 Received: from localhost ([127.0.0.1]:40962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5D9k-0001Po-79 for submit@debbugs.gnu.org; Fri, 02 Jun 2023 18:22:03 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:38917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5D9f-0001PV-QA for 63860@debbugs.gnu.org; Fri, 02 Jun 2023 18:21:59 -0400 Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-4f3af42459bso305963e87.0 for <63860@debbugs.gnu.org>; Fri, 02 Jun 2023 15:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685744509; x=1688336509; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+bMLLQ1MTF37nkO27u4ER20tTubp6D5XZ/2ihR4eg1o=; b=lsStt1KQHqsInp/ih77vvC1t+LKDCVNdVJkVM05n7M3eV+eohMwjP52Zg/NKe2/QcF L80oCiLD/fvlPNIu/3ajXV+IaIHzRS4dbTM4ZZk3CkQUwPfMep5xp7mvBr1uVTMpJ1Aj 4ryWELUxUDOOd/YqtXLogvjmu9pEVKqwQZ/bSKqc/4FHWcb8ZyebFvTV5igHqbKY2X2i ranbq5CVB8rpbCpwYWD85TGTfUnFAkvT9TaphjFj3A37+VcBK2ms7ae3Zijr9bkzMjA+ SzMT13O78/NiFZ1qsK7nCgIBha0SpCOIUt9eyZWE9yrhFymDo3KEFFabq4sxG6FFaAW7 jsJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685744509; x=1688336509; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+bMLLQ1MTF37nkO27u4ER20tTubp6D5XZ/2ihR4eg1o=; b=JK5ETtGlTLNvVCYVxrcZj88VLsg0DAB6HohWDzUeXSGSn0BvgMv3LxNmT3QcPbA9C9 oh5OvVNM7rI2W+vbBh4EbhnzK2kErRNpFtkeSuPeT4yylR1Pk9zbX89dzJ0EVccp+aSO VOFWVVoP/MR5P8u8YGXXV0dTLvfcALoLEHP+dciO4pCBy9BZgt3ui8Ryl4KaOgQubAS3 tM8Zg0jWtLiirj0R8jYft9+jdn3DMvCdZji7LcvRoRyXowW9Fz1yjBvQym7nRQC/Dko6 rbi/6qmgqPljzEl803n8NjFhRYB6++50FcGS6bDTKhZNnCPm2HrN5q8SU2nIVEz2/Qze nXcA== X-Gm-Message-State: AC+VfDyF+VjMYd1j48hH0wRlvXusB5dhofo4tkbyoj8nwQgw2wT8bTsV hOnta5G0HzN2T6Xc1P08n4SiOtu7QfE= X-Google-Smtp-Source: ACHHUZ4oBE9Di2NMZYwJOOfcuwZ4Kqgv0FfypH8Mk7A648EXWXY3AEGieCZuppeBWaVnLB3HqlvFSg== X-Received: by 2002:ac2:5544:0:b0:4f2:56d9:310a with SMTP id l4-20020ac25544000000b004f256d9310amr4099544lfk.0.1685744509288; Fri, 02 Jun 2023 15:21:49 -0700 (PDT) Received: from guixsd.wugi.info ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id w13-20020a05651203cd00b004ef11b30a17sm289730lfp.91.2023.06.02.15.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 15:21:48 -0700 (PDT) From: Oleg Pykhalov Date: Sat, 3 Jun 2023 01:21:22 +0300 Message-Id: <20230602222122.4723-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * etc/completion/bash/herd: New file. * Makefile.am (dist_bashcompletion_DATA): New variable. * configure.ac: Add --with-bash-completion-dir. --- Makefile.am | 4 ++ configure.ac | 9 ++++ etc/completion/bash/herd | 104 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 etc/completion/bash/herd diff --git a/Makefile.am b/Makefile.am index d82e75c..d7b5d36 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,7 @@ # Copyright © 2002, 2003 Wolfgang Jährling # Copyright © 2013-2016, 2018-2020, 2022-2023 Ludovic Courtès # Copyright © 2018 Carlo Zancanaro +# Copyright © 2023 Oleg Pykhalov # # This file is part of the GNU Shepherd. # @@ -135,6 +136,9 @@ doc/%.8: modules/shepherd/scripts/%.scm configure.ac dist_man1_MANS = doc/shepherd.1 doc/herd.1 dist_man8_MANS = doc/halt.8 doc/reboot.8 +# Bash completion file. +dist_bashcompletion_DATA = etc/completion/bash/herd + # Things not automatically included in the distribution. EXTRA_DIST += \ build-aux/config.rpath \ diff --git a/configure.ac b/configure.ac index 18455a0..8aaea92 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,15 @@ esac AC_MSG_RESULT([$build_crash_handler]) AM_CONDITIONAL([BUILD_CRASH_HANDLER], [test "x$build_crash_handler" = "xyes"]) +dnl Bash completion file. + +AC_ARG_WITH([bash-completion-dir], + AC_HELP_STRING([--with-bash-completion-dir=DIR], + [name of the Bash completion directory]), + [bashcompletiondir="$withval"], + [bashcompletiondir='${sysconfdir}/bash_completion.d']) +AC_SUBST([bashcompletiondir]) + dnl Manual pages. AM_MISSING_PROG([HELP2MAN], [help2man]) diff --git a/etc/completion/bash/herd b/etc/completion/bash/herd new file mode 100644 index 0000000..c6a1a63 --- /dev/null +++ b/etc/completion/bash/herd @@ -0,0 +1,104 @@ +# GNU Shepherd --- System service manager for GNU +# Copyright © 2023 Oleg Pykhalov +# +# This file is part of GNU Shepherd. +# +# GNU Shepherd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Shepherd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Shepherd. If not, see . + +# Bash completion for Shepherd commands. + +_herd_complete_subcommand() +{ + local command="${COMP_WORDS[1]}" + case "$command" in + discover) + complitions="guix-daemon" + COMPREPLY=($(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}")) + ;; + schedule) + complitions="mcron" + COMPREPLY=($(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}")) + ;; + set-http-proxy) + complitions="guix-daemon" + COMPREPLY=($(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}")) + ;; + *) + local services="$(herd status | grep '^ +\|^ -\| \*' | cut -d ' ' -f3)" + COMPREPLY=($(compgen -W "$services" -- "${COMP_WORDS[$COMP_CWORD]}")) + ;; + esac +} + +_herd_complete_3() +{ + local command="${COMP_WORDS[2]}" + case "$command" in + guix-daemon) + complitions="on off" + COMPREPLY=($(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}")) + ;; + *) + ;; + esac +} + +_herd_is_command () +{ + local word + local result="false" + for word in ${COMP_WORDS[*]} + do + if [ "$word" = "$1" ] + then + result=true + break + fi + done + $result +} + +_herd_complete() +{ + local word_count=${#COMP_WORDS[*]} + local word_at_point="${COMP_WORDS[$COMP_CWORD]}" + case $COMP_CWORD in + 1) + if [ -z "$_herd_subcommands" ] + then + # Cache the list of subcommands to speed things up. + _herd_subcommands=( + disable + discover + enable + schedule + set-http-proxy + start + status + stop + ) + _herd_subcommands="${_herd_subcommands[@]}" + fi + COMPREPLY=($(compgen -W "$_herd_subcommands" -- "${COMP_WORDS[$COMP_CWORD]}")) + ;; + *) + case $COMP_CWORD in + 2) _herd_complete_subcommand;; + 3) _herd_complete_3;; + esac + ;; + esac +} + +complete -F _herd_complete herd -- 2.38.0 From unknown Sat Jun 21 05:08:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63860] [PATCH v2] Add Bash completion file. References: <20230602221923.16196-1-go.wigust@gmail.com> In-Reply-To: <20230602221923.16196-1-go.wigust@gmail.com> Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Jun 2023 09:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63860@debbugs.gnu.org Cc: Oleg Pykhalov Received: via spool by 63860-submit@debbugs.gnu.org id=B63860.168578513829958 (code B ref 63860); Sat, 03 Jun 2023 09:39:02 +0000 Received: (at 63860) by debbugs.gnu.org; 3 Jun 2023 09:38:58 +0000 Received: from localhost ([127.0.0.1]:41568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Nir-0007n7-Jy for submit@debbugs.gnu.org; Sat, 03 Jun 2023 05:38:58 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:40150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Nio-0007mu-Or for 63860@debbugs.gnu.org; Sat, 03 Jun 2023 05:38:56 -0400 Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-4f60924944aso456920e87.0 for <63860@debbugs.gnu.org>; Sat, 03 Jun 2023 02:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685785128; x=1688377128; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VNjkQJ5H3lSdRAbYOwc4PZQv//94zQhPGimZlSInhSU=; b=g5O4+6gV0Ya+A63t8XzqkALAVJEbCmd+BnGB3E5bI/1BLvC7lkClmMAndxrSMRpQ4c V6lptymr3k9JaRDEqVno2DAcDIPPR0WKio/NdrdOxUzr1Pr5YdWWbpSfBV5TyTxq1d+U aUFdIGgoC08xvgfZ1KOfyPkBHkQOIpDZUyc2nFywxqAXqULHwSGU2XlqVEqUkj3xcvLE KEH8N0HOXoMGwranKULzzcgL7dH78SGkp2ZKNiD80XHnSi+FQfMdzeC0fLZXPAtFuCt1 e7so3PCCOYH5s6d6Y8MCiy2NK3mdZfDAxAqmCy7x6rNzJD9vaJS0lsW9eMGuCPneiDuV wQBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685785128; x=1688377128; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VNjkQJ5H3lSdRAbYOwc4PZQv//94zQhPGimZlSInhSU=; b=TpaWTsxa/2oblASVxl467p38jVo/Dtu+txS5mXCyCpatZRI6l7FCcZNuctnmzAuc1G Zgr+GhpP0Ug1MRfhRUW+8kHThhd8TnoqJHTaVDaV/GOzko0mB8VU+TJCOxsxW56NqEwK 3p4EFjnwkeEMfjc5N3oiMCyfooauPz+S4el2iH0LCcZMEUOFDLJnX/7uKntEBpcZ9b+c mTHt3wq/7FkA0MV420WNUP2I+yA723U6rtvt3evUUJrRiJa+DeFRFSEaE1ByxL4A5dGc 9RZQq+g5jrucpgHmnh47oiZ2pMFvLd+w1uo6cgFJAwVOM72m+lVrxt26GX+V4K3zFudH NvNg== X-Gm-Message-State: AC+VfDzS3LtdGe/nQ8OwUbqJY1rJDD64+UZGSMC0nPI3AMLbZTc1nplY Q3gN5v8x/lne4Bfc+y/JoX89PPq59Ug= X-Google-Smtp-Source: ACHHUZ6XJbZOf8/F7vjBm2nFLk0Zrex2JOBUSPhSJoPNpgL7Kk9A7GzjDR5bfVHCGf48oZ3/FkJMqg== X-Received: by 2002:ac2:55b0:0:b0:4f6:949:8434 with SMTP id y16-20020ac255b0000000b004f609498434mr3300677lfg.0.1685785128076; Sat, 03 Jun 2023 02:38:48 -0700 (PDT) Received: from guixsd.wugi.info ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id p17-20020a19f011000000b004f60ac51ff2sm433707lfc.189.2023.06.03.02.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jun 2023 02:38:47 -0700 (PDT) From: Oleg Pykhalov Date: Sat, 3 Jun 2023 12:37:01 +0300 Message-Id: <20230603093659.14873-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * etc/completion/bash/herd: New file. * Makefile.am (dist_bashcompletion_DATA): New variable. * configure.ac: Add --with-bash-completion-dir. --- Makefile.am | 4 ++ configure.ac | 9 ++++ etc/completion/bash/herd | 103 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 etc/completion/bash/herd diff --git a/Makefile.am b/Makefile.am index d82e75c..d7b5d36 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,7 @@ # Copyright © 2002, 2003 Wolfgang Jährling # Copyright © 2013-2016, 2018-2020, 2022-2023 Ludovic Courtès # Copyright © 2018 Carlo Zancanaro +# Copyright © 2023 Oleg Pykhalov # # This file is part of the GNU Shepherd. # @@ -135,6 +136,9 @@ doc/%.8: modules/shepherd/scripts/%.scm configure.ac dist_man1_MANS = doc/shepherd.1 doc/herd.1 dist_man8_MANS = doc/halt.8 doc/reboot.8 +# Bash completion file. +dist_bashcompletion_DATA = etc/completion/bash/herd + # Things not automatically included in the distribution. EXTRA_DIST += \ build-aux/config.rpath \ diff --git a/configure.ac b/configure.ac index 18455a0..8aaea92 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,15 @@ esac AC_MSG_RESULT([$build_crash_handler]) AM_CONDITIONAL([BUILD_CRASH_HANDLER], [test "x$build_crash_handler" = "xyes"]) +dnl Bash completion file. + +AC_ARG_WITH([bash-completion-dir], + AC_HELP_STRING([--with-bash-completion-dir=DIR], + [name of the Bash completion directory]), + [bashcompletiondir="$withval"], + [bashcompletiondir='${sysconfdir}/bash_completion.d']) +AC_SUBST([bashcompletiondir]) + dnl Manual pages. AM_MISSING_PROG([HELP2MAN], [help2man]) diff --git a/etc/completion/bash/herd b/etc/completion/bash/herd new file mode 100644 index 0000000..06afaae --- /dev/null +++ b/etc/completion/bash/herd @@ -0,0 +1,103 @@ +# GNU Shepherd --- System service manager for GNU +# Copyright © 2023 Oleg Pykhalov +# +# This file is part of GNU Shepherd. +# +# GNU Shepherd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Shepherd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Shepherd. If not, see . + +# Bash completion for Shepherd commands. + +_herd_complete_subcommand() +{ + local command="${COMP_WORDS[1]}" + case "$command" in + discover) + complitions="guix-daemon" + mapfile -t COMPREPLY < <(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + schedule) + complitions="mcron" + mapfile -t COMPREPLY < <(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + set-http-proxy) + complitions="guix-daemon" + mapfile -t COMPREPLY < <(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + *) + local services + services="$(herd status | grep '^ +\|^ -\| \*' | cut -d ' ' -f3)" + mapfile -t COMPREPLY < <(compgen -W "$services" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + esac +} + +_herd_complete_3() +{ + local command="${COMP_WORDS[2]}" + case "$command" in + guix-daemon) + complitions="on off" + mapfile -t COMPREPLY < <(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + *) + ;; + esac +} + +_herd_is_command () +{ + local word + local result="false" + for word in "${COMP_WORDS[@]}" + do + if [ "$word" = "$1" ] + then + result=true + break + fi + done + $result +} + +_herd_complete() +{ + case $COMP_CWORD in + 1) + if [ -z "$_herd_subcommands" ] + then + # Cache the list of subcommands to speed things up. + _herd_subcommands_list=( + disable + discover + enable + schedule + set-http-proxy + start + status + stop + ) + _herd_subcommands="${_herd_subcommands_list[*]}" + fi + mapfile -t COMPREPLY < <(compgen -W "$_herd_subcommands" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + *) + case $COMP_CWORD in + 2) _herd_complete_subcommand;; + 3) _herd_complete_3;; + esac + ;; + esac +} + +complete -F _herd_complete herd -- 2.38.0 From unknown Sat Jun 21 05:08:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63860] [PATCH] Shepherd: Add Bash completion file. Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Jun 2023 09:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63860@debbugs.gnu.org Received: via spool by 63860-submit@debbugs.gnu.org id=B63860.168578532930289 (code B ref 63860); Sat, 03 Jun 2023 09:43:01 +0000 Received: (at 63860) by debbugs.gnu.org; 3 Jun 2023 09:42:09 +0000 Received: from localhost ([127.0.0.1]:41572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Nlx-0007sT-FH for submit@debbugs.gnu.org; Sat, 03 Jun 2023 05:42:09 -0400 Received: from mail-lf1-f48.google.com ([209.85.167.48]:40247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Nlu-0007rx-Bw for 63860@debbugs.gnu.org; Sat, 03 Jun 2023 05:42:07 -0400 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-4f14e14dc00so451226e87.1 for <63860@debbugs.gnu.org>; Sat, 03 Jun 2023 02:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685785320; x=1688377320; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=2XeroMD8uVn+/YSRUZxiPP+G0Lw3oMk2xCBBk9yUaJI=; b=RO2VtKpAhB9dB/NDoVJGsdONHCH+FcaQ+l6KoYYWbk6aWxU/ImTGvIhcznUH+YGqqG ZsekyrxIkK5nNKxhWieIj4RQlve7BDXb3wX8syS99YZ5k0e76b7bs7eWso457/6+dyLz KjuhXIsqx9pkHQM3FQl0bHXqi4pF9btBKxeE8kt6PEPVhO0Yr45P4DqGLglM2q2qoNaV FuOkbDdQ1wxojBtcVVjjpuaqe2hSa8+ywJLf2BUm+Db3lyNTUfoZmPQRNa1jvUW86NZ2 Pf4NLyJl1FumxMDasTGEb3mTroeZ05SklqeHhOhuEVEY4x0bLakXCEKUxpbWc1bO9ZNq yTKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685785320; x=1688377320; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2XeroMD8uVn+/YSRUZxiPP+G0Lw3oMk2xCBBk9yUaJI=; b=ds7SATtc3yIvtIxqK0A0xCs4e+TfjkHhS5cla448uyeXxcsOxIPeaxOZKKYHBxMB3L yI4RAjjDXmHOBIHAcizG69VLNiyI5qLMMSwfICvRjJku4iGPe1KtXoAjXyuxEZ5m8Qe8 3rM13Cs/QEK20nb/1RmM9/wPYPJmUC01CzsdZiTcIlqCM+aZRx+IM9JJ/Onou1ptJkFC SanZkI4gvTG/NLRI6X2s0c2rk8nTLNMzxdczeFLFk16vCLV2wVMDqKVtNfBc2niLKUt6 M8yAYLPRl7X66xuxc2Y9nk8c0uxN8X8vuC00cnq4FONmkGRR9g+QlhQNdgXdBSvjwAIW KzCQ== X-Gm-Message-State: AC+VfDz8WR7E5JI5L3xDrTvVDHoDRmyCkudG4bOfkbErFH2YgCUxCGUU 2mpIsjtwfUH0RruLuReAbAIKT/FCf9o= X-Google-Smtp-Source: ACHHUZ7F3xTTLoYzbWib29CcGGr7QV9NBvAQ3+JGOiw5eY+7ZK1JSKk8/qmIvUAt7RJAgifYcku4aA== X-Received: by 2002:ac2:5999:0:b0:4f6:1c08:e9b4 with SMTP id w25-20020ac25999000000b004f61c08e9b4mr279865lfn.6.1685785320053; Sat, 03 Jun 2023 02:42:00 -0700 (PDT) Received: from localhost ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id d16-20020ac25450000000b004efe8174586sm435379lfn.126.2023.06.03.02.41.59 for <63860@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jun 2023 02:41:59 -0700 (PDT) From: Oleg Pykhalov References: <20230602221923.16196-1-go.wigust@gmail.com> <20230603093659.14873-1-go.wigust@gmail.com> Date: Sat, 03 Jun 2023 12:41:59 +0300 In-Reply-To: <20230603093659.14873-1-go.wigust@gmail.com> (Oleg Pykhalov's message of "Sat, 3 Jun 2023 12:37:01 +0300") Message-ID: <87jzwkkhlk.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Oleg Pykhalov writes: > * etc/completion/bash/herd: New file. > * Makefile.am (dist_bashcompletion_DATA): New variable. > * configure.ac: Add --with-bash-completion-dir. > --- > Makefile.am | 4 ++ > configure.ac | 9 ++++ > etc/completion/bash/herd | 103 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 116 insertions(+) > create mode 100644 etc/completion/bash/herd v2 fixes warnings reported by shellcheck utility, which should be used in the first place, apologies. Everything else works in the same way. Regards, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmR7CucUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pzI7g//YAdzECA+i2eswfn++9AtBkroK2K3 ET0aN2LDnA8N/00RAOCIm89kAkObd6slZTdW14suXww50o1D/bKdQ0uE9h6/1jj7 PhEISAuURmrgp7EW+7rBVLI3rW2sp2QB0ywD49rJahsp0MuwUu3TaMlZjuXdlyJW vddUw0fPK+FbP66OuKAhQfx9qYzW+y6HSXDBXGRI8VRzg/RY5m+qgj/Hz0z/8XmM MNYFD8eeQuBu7L7LrYmruWTF8gsHoKylaStuuCloX3dIvFpsv0/xFz/80meNGf40 1ocaH0RPZmFuVCYxhL75eUO1/OE5X+I9/d4dSzqN9X2xUcQsM2K4txUCcKLqdpcp C0jzk20Lrr93UmFrjTdgidwvBwb8QBWYY7zmXwxkm5NBPtDGxiuPeHegnQXsCFMq +arcFIbvxmv5nTf5ZIhxTzf49eIT50L/TyQ21XpnsD2vn7k7lCsYkxGTqV4f7SkD N3ayhL0x5OfIhNUuLFZ7rcYYTJCsOdDEjWGmcR5OxGUQ276g6FJoGimxcHCzYqMB ztV6/sxepl1DXIkowkgQsx8iaULwautL1Pg9dgpE2dQ4Ueir7vkdZR5U75ox+jLQ ywpOWE6uHQSfPmOuj+/Wjf5iXwrjGOCYWpGnMLQ4Z4CcZKLnE8XnHT5dPbhbFrfj Un5xrVIk8yVYqTQ= =SF2d -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Jun 21 05:08:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63860] [PATCH v2] Add Bash completion file. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Jun 2023 18:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Oleg Pykhalov , 63860@debbugs.gnu.org Received: via spool by 63860-submit@debbugs.gnu.org id=B63860.16858164125963 (code B ref 63860); Sat, 03 Jun 2023 18:21:01 +0000 Received: (at 63860) by debbugs.gnu.org; 3 Jun 2023 18:20:12 +0000 Received: from localhost ([127.0.0.1]:44274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5VrI-0001Y6-6m for submit@debbugs.gnu.org; Sat, 03 Jun 2023 14:20:12 -0400 Received: from mail-ej1-f67.google.com ([209.85.218.67]:51702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5VrF-0001Xo-1u for 63860@debbugs.gnu.org; Sat, 03 Jun 2023 14:20:10 -0400 Received: by mail-ej1-f67.google.com with SMTP id a640c23a62f3a-977c88c9021so66659966b.3 for <63860@debbugs.gnu.org>; Sat, 03 Jun 2023 11:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685816403; x=1688408403; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=hg08OY2oBBo6B2vPrv/wn9rKNtD0RqyvsaWzwR7+w8w=; b=VUtnjgV25tI4XYZ/lfg2bCDlUs75zjFofhNhOyFAaUNdXk4meg7M/5hrf1kleDQCjR VCW7pS0EkZZKFt3ywK3ZTczNmPVSCzNwKaJuzoMT4C4DctqmqxuJMRWyBYz2GRhdha/c M3LrvVLulFFfZtFtFEMqGu1d5Jnkp/zKfs1DgyOYRkKhQku826iGNO2mdQLXdmvclmj4 d1mbnAhx+oDV6v4Z8KkQjfThXzVyG5ZLBVGSHnF40NbqtUBJLQ3f5YHbepgFS0NHV0Ck wc5P2bPxadICnF8l/wrf3P3Y/GOHMbxH9uBfspeRDmLPW9FL3v08qBOXxUCVZIGN16fo jdWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685816403; x=1688408403; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hg08OY2oBBo6B2vPrv/wn9rKNtD0RqyvsaWzwR7+w8w=; b=YveECYLsygWSLhPMuTLSNdY2jYynIeJaW++cJfRn82T97hW5LGwwDBidAktr+4AhHi b69wr/pQuNrqy2/jVmMyNMnRkZUgWT3gDZXJ/B1R9sb3BDZj2ODIjp1jv+AFM5tDP+/4 mzKApNlJ1a9bOYi21bjbQx1O2NngR9Y+Wlc97boomHZqT4xxpM1JyK3LB4bn+3Er+gaD eENgQz3YvCzE7CWjYWo0eNNjZTVeakh5e2BDyf4qIJV7SNY0y3UEtFPBvwcqP9aigfBi Jw1kKx9zgX/2U/vfP8cMrRx5LxGeglivEobIbOsAG2BMYEb5yYs2x+3ugYN71KUxT9Pk swNw== X-Gm-Message-State: AC+VfDyE6h4wMALLO8dok0WfG8Me9S96/9VDHbNWW7giisYrE2comzG0 rdZ6bPdAyK9bcOzmUkQhAD0= X-Google-Smtp-Source: ACHHUZ6UHT6qnajY/+Qzzc/2Z7mbjdVYXT44C6bKTyOJR9NugU0OYla4JKvYMOSfWwC33rnbe/ICFA== X-Received: by 2002:a17:907:6287:b0:96f:1f79:c0a6 with SMTP id nd7-20020a170907628700b0096f1f79c0a6mr1865782ejc.70.1685816402812; Sat, 03 Jun 2023 11:20:02 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id l11-20020a170906414b00b0096607baaf19sm2173801ejk.101.2023.06.03.11.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jun 2023 11:20:02 -0700 (PDT) Message-ID: From: Liliana Marie Prikler Date: Sat, 03 Jun 2023 20:20:00 +0200 In-Reply-To: <20230603093659.14873-1-go.wigust@gmail.com> References: <20230603093659.14873-1-go.wigust@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) QW0gU2Ftc3RhZywgZGVtIDAzLjA2LjIwMjMgdW0gMTI6MzcgKzAzMDAgc2NocmllYiBPbGVnIFB5 a2hhbG92Ogo+ICogZXRjL2NvbXBsZXRpb24vYmFzaC9oZXJkOiBOZXcgZmlsZS4KPiAqIE1ha2Vm aWxlLmFtIChkaXN0X2Jhc2hjb21wbGV0aW9uX0RBVEEpOiBOZXcgdmFyaWFibGUuCj4gKiBjb25m aWd1cmUuYWM6IEFkZCAtLXdpdGgtYmFzaC1jb21wbGV0aW9uLWRpci4KPiAtLS0KPiDCoE1ha2Vm aWxlLmFtwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgfMKgwqAgNCArKwo+IMKgY29uZmlndXJl LmFjwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIHzCoMKgIDkgKysrKwo+IMKgZXRjL2NvbXBsZXRp b24vYmFzaC9oZXJkIHwgMTAzCj4gKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrCj4gwqAzIGZpbGVzIGNoYW5nZWQsIDExNiBpbnNlcnRpb25zKCspCj4gwqBjcmVhdGUgbW9k ZSAxMDA2NDQgZXR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wqDCoMKgwqAgbWFwZmlsZSAt dCBDT01QUkVQTFkgPCA8KGNvbXBnZW4gLVcgIiRfaGVyZF9zdWJjb21tYW5kcyIKPiAtLSAiJHtD T01QX1dPUkRTWyRDT01QX0NXT1JEXX0iKQo+ICvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIDs7Cj4g K8KgwqDCoMKgwqDCoMKgICopCj4gK8KgwqDCoMKgwqDCoMKgwqDCoMKgwqAgY2FzZSAkQ09NUF9D V09SRCBpbgo+ICvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAyKSBfaGVyZF9jb21wbGV0 ZV9zdWJjb21tYW5kOzsKPiArwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgMykgX2hlcmRf Y29tcGxldGVfMzs7Cj4gK8KgwqDCoMKgwqDCoMKgwqDCoMKgIGVzYWMKPiArwqDCoMKgwqDCoMKg wqDCoMKgwqDCoCA7Owo+ICvCoMKgwqAgZXNhYwo+ICt9Cj4gKwo+ICtjb21wbGV0ZSAtRiBfaGVy ZF9jb21wbGV0ZSBoZXJkCgpDaGVlcnMK From unknown Sat Jun 21 05:08:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63860] [PATCH v2] Add Bash completion file. Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Jun 2023 19:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 63860@debbugs.gnu.org Received: via spool by 63860-submit@debbugs.gnu.org id=B63860.168582051612784 (code B ref 63860); Sat, 03 Jun 2023 19:29:01 +0000 Received: (at 63860) by debbugs.gnu.org; 3 Jun 2023 19:28:36 +0000 Received: from localhost ([127.0.0.1]:44329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5WvU-0003K8-Fe for submit@debbugs.gnu.org; Sat, 03 Jun 2023 15:28:36 -0400 Received: from mail-lj1-f169.google.com ([209.85.208.169]:38239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5WvO-0003Jq-H7 for 63860@debbugs.gnu.org; Sat, 03 Jun 2023 15:28:35 -0400 Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2b1b5d1bbf1so2725631fa.1 for <63860@debbugs.gnu.org>; Sat, 03 Jun 2023 12:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685820505; x=1688412505; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=0WG9+eIqbC5UXPq7FlGe7c472ek34B3dmrB0pMPwT2M=; b=GTO8Ipy+ZYWDxmj6bnKHuuBnyT1Pn2+DmXssRe0L+PT0GARf+I78cTEBB830VqT2QC +SDqRbhNNYMTlmGB+Z7Qofj0jEz5jA/ohoJOcwOU3RcCoZOwuaD3tgkdJTtshy6/Arwm X+r3uTzGflZykFxOX/NK+dHo+7G69vfpqC9G7EELLCE40dz/ihN60AESHMgAT/8fbjlk 130qyftBQPp65olW1cowKP0tEOz/XqlzWemoDhkfq6YoEn5VbrFFXL9eRWxQtVZ1Bfgd Yh8tGm6PlYkQgnfAvTNL6gGJVbrgyiGx+yBhM+L78QfbcNiV8aqmEotwEs0HzOf55oY8 N9Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685820505; x=1688412505; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0WG9+eIqbC5UXPq7FlGe7c472ek34B3dmrB0pMPwT2M=; b=gN5yvwpg/y3EwLlPxvc2+v8xnjYvgDJkUx/iep6hliDJscNIKdjX2OqJwCMWn3CUpN D8gPjw8nU2psDQLVY8QJk8J3FKqHVEz0uGfcYgqeuFW2tKP/huv6J+1nqmQaQfS768X5 K7gPvqb9kzMqQJPH5L1O1nS3lYU7hVxSoCUS4HQuQF2EE+M1IIe4NgThZk22r3IpDL2g GQpWxUyz3QNStXzarekyyyrzcNtC3s0Hgs9/8hYASbK5QP7exkd78XzdLukX6t/BdYPN 01ZYZEQRvlCq+tA8OZElNisk0OOzGzwe1pK7x4wkdxhy/9lo0sY6p0qffOyRdMqEuxDv yACg== X-Gm-Message-State: AC+VfDx/fseolpa4QyTHWP6/KhX7qkTkE34tP8pbB/4iBjWw5NV67swR +vVfjrInUpeVRB22/4pRTlk7K2mJafc= X-Google-Smtp-Source: ACHHUZ5To/VoVc601xIp1wkdwNrxu63c9pWffgvxQYSLsfdTZ1T6bSNeH9qhcS0MMyEuWQ7wgBuxDA== X-Received: by 2002:ac2:5983:0:b0:4f1:45b7:2e5b with SMTP id w3-20020ac25983000000b004f145b72e5bmr4340784lfn.3.1685820504388; Sat, 03 Jun 2023 12:28:24 -0700 (PDT) Received: from localhost ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id g7-20020a19ee07000000b004f517c21ef4sm561300lfb.44.2023.06.03.12.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jun 2023 12:28:23 -0700 (PDT) From: Oleg Pykhalov References: <20230603093659.14873-1-go.wigust@gmail.com> Date: Sat, 03 Jun 2023 22:28:23 +0300 In-Reply-To: (Liliana Marie Prikler's message of "Sat, 03 Jun 2023 20:20:00 +0200") Message-ID: <87sfb8ibvs.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Liliana Marie Prikler writes: [=E2=80=A6] >> +{ >> +=C2=A0=C2=A0=C2=A0 local command=3D"${COMP_WORDS[1]}" >> +=C2=A0=C2=A0=C2=A0 case "$command" in >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 discover) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 comp= litions=3D"guix-daemon" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mapf= ile -t COMPREPLY < <(compgen -W "$complitions" -- >> "${COMP_WORDS[$COMP_CWORD]}") >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; > Is there a reason to call the variable "complitions" rather than > "completions" No reason, it's a typo probably from autocompletion of my editor. :-) > or using an immediate value? Do you mean to use the following? =2D-8<---------------cut here---------------start------------->8--- case "$command" in discover) mapfile -t COMPREPLY < <(compgen -W guix-daemon -- "${COMP_WORD= S[$COMP_CWORD]}") ;; ... =2D-8<---------------cut here---------------end--------------->8--- yes, this will work. No strong opinion on that, both ways would work for me. Regards, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmR7lFcUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pzScw/+IiG0WTcNP0jAIAVsQm5QftF5r+oR Ccm2qWAcKgiyXKQ8vFatcQUZtaBx0F0IneOU8JBqAPXbU46qI6OZwWWcCTehOFs7 Ncxkh/wfPBQa/vGAkBdtEVcXEbPdygHxkHi2Z8rfos19y18+CvWGVLclToEOT0cZ 7rE1p2jUmbDzzj9ITFyt1YzJrZBTlOGxMqInNDo8vVNI4BPTUJ0lVk5gFgFaXqat 5UAtVKFdMk0WH+mZMfjJQZOnZXdK7Vm2Z12g2vinN3VJ5yezJ+r+puZddA84mVPR XYn70T0hOYv2pftTxdspVVm7ten61w3hBJzmbWtGv4ajDo42PkykmmSrMHDDjJMN S8IuJ7gsz7hw4admCqDO77Ex99DsbNj3TKk+wuuWaH0+3RrXjsbrstpfZcobUdzV ghomtZe9WtQAo15k5AYHs7jTv4Kp0302mbOx4dfwZKDvy/oncQVEMM9tZQxWHPXo pPuZiZl4XdMjs1KfFrsep5MtApEFIaL5imvGhI7DcLYkMX3WG0y/GstKlheCetm4 +jd8XAAf0ttZt6X7ltm8l4HN3lhBtgSZWoX+SsfKL22HPGyXKHIPFz80R6Icw2Ll zM3TqN67dTHHqfpZzTQLbf5Zx5DAOFV1nIM8+LsGpHaSrWgGd7oFHFYvU8V+kpAg 67FH/B14eZ9apls= =96og -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Jun 21 05:08:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63860] [PATCH v2] Add Bash completion file. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Jun 2023 21:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Oleg Pykhalov Cc: 63860@debbugs.gnu.org Received: via spool by 63860-submit@debbugs.gnu.org id=B63860.168582853626099 (code B ref 63860); Sat, 03 Jun 2023 21:43:02 +0000 Received: (at 63860) by debbugs.gnu.org; 3 Jun 2023 21:42:16 +0000 Received: from localhost ([127.0.0.1]:44452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Z0p-0006mr-Ry for submit@debbugs.gnu.org; Sat, 03 Jun 2023 17:42:16 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:61927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Z0n-0006me-8y for 63860@debbugs.gnu.org; Sat, 03 Jun 2023 17:42:14 -0400 Received: by mail-ed1-f68.google.com with SMTP id 4fb4d7f45d1cf-51480d3e161so4999397a12.3 for <63860@debbugs.gnu.org>; Sat, 03 Jun 2023 14:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685828527; x=1688420527; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=R6VfXi56e9rF33nMQ0sc4qswk6MoulgeM37RtH67LPs=; b=bN328pOPv52DQ2f+EfGI4nLBMM9NYOA2Ls+vyHbALjMi4eNLnI43cHlwVRJi1Vy7HE Q63juSTPNpbSmkFgQLRnQnKPGVCIF6pBNRwhAhRF32B9REk4HXBw1hDhy36RtDSJUiCv xWKxEEc/wQDf2Z/clE6dy+sUeaExFjHq8bdj4Iunu09x9CCInXN06wT2PeUHAUrTKT73 LIvvTwHFYvL6SFgnmxCYhvRc9ZQNCTv62x/oNUCDkgwxihuM+YyxjlXRy/CLSuGFUyIs k2V45aP855P/t9pdP9Vny3Gs1p/HAsQt30/J/DbfPpaziqlyXKL5SKsKtZw/i61U2KTh rioA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685828527; x=1688420527; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=R6VfXi56e9rF33nMQ0sc4qswk6MoulgeM37RtH67LPs=; b=WsUlyqrd2H17iDoX7K4fHx6mw3ADanAM/jlkA28mfDHAf+SYm4BD8tgWNrrDrxQ01Q T/72qU9t8D6EvqcOXRMBXWhQIWg2OBPfbfFdJrw95Na3ey1vSvXRyKga6IHrb9aXDJGe RUwHmIHWRGvx5UBm6bWu6ZANg8Qql+T7IFfQTcQwUiMKbjZJQfWBH6VvIMyAA0hD7EOq foPRguJxKSWr6LdCGsdJVZpLhk8bUd2/y4Bq3yIYjEoOd9JXO099MIVCrspdmKUOcSuw CQAtMnrRD6CP3wzTH8//ZaWRXcYjKv6W4lKaRZZzC37a8NnRRSBlzkt6g4SoEigOVz2v A6eg== X-Gm-Message-State: AC+VfDxR0YgRy2v2BEZ2H2CfMfSKPp3WtC1hy/7nSBY+BxagOwnGRzpC kcF7NnRd+DBX8GWJoKJnY7ieefyijGG13ekv X-Google-Smtp-Source: ACHHUZ4ELA/4MR7+IO1nejRsz7KbL58NhGIUh3CJBTUwnngqdsZ9LuDU1gD2del6imwkUD6qYoqGug== X-Received: by 2002:aa7:c543:0:b0:514:9e4d:c8b9 with SMTP id s3-20020aa7c543000000b005149e4dc8b9mr5322449edr.11.1685828526784; Sat, 03 Jun 2023 14:42:06 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id n26-20020aa7db5a000000b005149e012658sm2144589edt.34.2023.06.03.14.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jun 2023 14:42:06 -0700 (PDT) Message-ID: <940cd99ec2de7a9d6b6e0ea98670f0031891cdda.camel@gmail.com> From: Liliana Marie Prikler Date: Sat, 03 Jun 2023 23:42:05 +0200 In-Reply-To: <87sfb8ibvs.fsf@gmail.com> References: <20230603093659.14873-1-go.wigust@gmail.com> <87sfb8ibvs.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Am Samstag, dem 03.06.2023 um 22:28 +0300 schrieb Oleg Pykhalov: > Liliana Marie Prikler writes: >=20 > [=E2=80=A6] >=20 > > > +{ > > > +=C2=A0=C2=A0=C2=A0 local command=3D"${COMP_WORDS[1]}" > > > +=C2=A0=C2=A0=C2=A0 case "$command" in > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 discover) > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 c= omplitions=3D"guix-daemon" > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 m= apfile -t COMPREPLY < <(compgen -W "$complitions" - > > > - > > > "${COMP_WORDS[$COMP_CWORD]}") > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;= ; > > Is there a reason to call the variable "complitions" rather than > > "completions" >=20 > No reason, it's a typo probably from autocompletion of my editor. :-) >=20 > > or using an immediate value? >=20 > Do you mean to use the following? > --8<---------------cut here---------------start------------->8--- > =C2=A0=C2=A0=C2=A0 case "$command" in > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 discover) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mapfil= e -t COMPREPLY < <(compgen -W guix-daemon -- > "${COMP_WORDS[$COMP_CWORD]}") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; > =C2=A0=C2=A0=C2=A0 ... > --8<---------------cut here---------------end--------------->8--- >=20 > yes, this will work. I'd still quote "guix-daemon", but yeah. Cheers From unknown Sat Jun 21 05:08:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63860] [PATCH v3] Add Bash completion file. Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Jun 2023 08:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63860 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63860@debbugs.gnu.org Cc: Oleg Pykhalov , Liliana Marie Prikler Received: via spool by 63860-submit@debbugs.gnu.org id=B63860.168586908111453 (code B ref 63860); Sun, 04 Jun 2023 08:58:02 +0000 Received: (at 63860) by debbugs.gnu.org; 4 Jun 2023 08:58:01 +0000 Received: from localhost ([127.0.0.1]:44983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5jYm-0002yf-WF for submit@debbugs.gnu.org; Sun, 04 Jun 2023 04:58:01 -0400 Received: from mail-lj1-f180.google.com ([209.85.208.180]:40045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5jYj-0002yF-Jv for 63860@debbugs.gnu.org; Sun, 04 Jun 2023 04:57:59 -0400 Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2b1a4d74f7fso3957881fa.0 for <63860@debbugs.gnu.org>; Sun, 04 Jun 2023 01:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685869071; x=1688461071; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XuOtMlBBJGDFZAwG2iQz9OAbHOG2iECBpoZcEuwK2oc=; b=EIQ4kfJ5rGludxKyYglggNo4cceqVsyKYBs5eQnYzdWUDmAft29nbi6TI4MfgK6u4X o7yhWqxtWttI6k761K4ZFz9MwUCRkMnJVKqibQIDWAaV5WwnD5QlPZOv4GTqLJyLFeMW BJao+1RTp3TjmD+i0tK1PeJMtv/4qSL3Na1GTvZaDzR6EOtsKq2D2bnGRn02mCWLr64x PPYmHl7PpTUgVE7vVD18TXJRpZc+0MhpQx785Wvy4HU/TVfWnVyZtTrjhS9jFYM/t0il Ozn1GnfwWsCcZIqWjQgFPK0KGNKQs3DYKfPGtV3kkgntpDZZEzmoTQRE+Sfu2cyJDnLL w/Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685869071; x=1688461071; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XuOtMlBBJGDFZAwG2iQz9OAbHOG2iECBpoZcEuwK2oc=; b=VVGxYk29ZuEy60z4BtMc5wPhiZrHe9aWE/qGiySgeUTmI6xbnk3K8wzpNfiwJdyTYE dfn3zNi8xOnK3FVWaUTyfnU16NjpYu0glZeiuUXRTcYhPTLvRntvwvMZi+ezlhRxoIXN DpDfGAGxRBCgpczJS0QS2DPjNa1tXdJ3BH/Pn5QqeigxzgSLjsr6/MY2x5BjZGf6tYzw 20uU8lwWsAxNyMEEG+YKl0FmGPQI6XcETgHopZgo1uXeDuWyaRAnXjcdplsrPHakg3Vh dKsLBbTy8Kk2in8fsM65Tl4fx201DVOTAzMTOS4JN+6HOk/nQN0HAjpx3dFB92T9jECv zHWQ== X-Gm-Message-State: AC+VfDzEjqIfH7EpzxJiRP1pJR+/K3/JjhkCrJm0JuD+oM2uWoDgl0XN Pxh3bUN2hV8Kf3Ky6rQXCKtjm7GrZ0Q= X-Google-Smtp-Source: ACHHUZ66OZQqz25pLo98BtYGZJG8hkJT2jYtuvFwLyeGJHVhj3RiAsk2Mi6gFnr5ZO/kuiw1ZlSrCg== X-Received: by 2002:ac2:5d24:0:b0:4f3:a878:2c02 with SMTP id i4-20020ac25d24000000b004f3a8782c02mr5930006lfb.4.1685869070800; Sun, 04 Jun 2023 01:57:50 -0700 (PDT) Received: from guixsd.wugi.info ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id p22-20020ac246d6000000b004f606755537sm719832lfo.298.2023.06.04.01.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jun 2023 01:57:50 -0700 (PDT) From: Oleg Pykhalov Date: Sun, 4 Jun 2023 11:57:16 +0300 Message-Id: <20230604085716.31735-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <940cd99ec2de7a9d6b6e0ea98670f0031891cdda.camel@gmail.com> References: <940cd99ec2de7a9d6b6e0ea98670f0031891cdda.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * etc/completion/bash/herd: New file. * Makefile.am (dist_bashcompletion_DATA): New variable. * configure.ac: Add --with-bash-completion-dir. --- Makefile.am | 4 ++ configure.ac | 9 ++++ etc/completion/bash/herd | 100 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 etc/completion/bash/herd diff --git a/Makefile.am b/Makefile.am index d82e75c..d7b5d36 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,7 @@ # Copyright © 2002, 2003 Wolfgang Jährling # Copyright © 2013-2016, 2018-2020, 2022-2023 Ludovic Courtès # Copyright © 2018 Carlo Zancanaro +# Copyright © 2023 Oleg Pykhalov # # This file is part of the GNU Shepherd. # @@ -135,6 +136,9 @@ doc/%.8: modules/shepherd/scripts/%.scm configure.ac dist_man1_MANS = doc/shepherd.1 doc/herd.1 dist_man8_MANS = doc/halt.8 doc/reboot.8 +# Bash completion file. +dist_bashcompletion_DATA = etc/completion/bash/herd + # Things not automatically included in the distribution. EXTRA_DIST += \ build-aux/config.rpath \ diff --git a/configure.ac b/configure.ac index 18455a0..8aaea92 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,15 @@ esac AC_MSG_RESULT([$build_crash_handler]) AM_CONDITIONAL([BUILD_CRASH_HANDLER], [test "x$build_crash_handler" = "xyes"]) +dnl Bash completion file. + +AC_ARG_WITH([bash-completion-dir], + AC_HELP_STRING([--with-bash-completion-dir=DIR], + [name of the Bash completion directory]), + [bashcompletiondir="$withval"], + [bashcompletiondir='${sysconfdir}/bash_completion.d']) +AC_SUBST([bashcompletiondir]) + dnl Manual pages. AM_MISSING_PROG([HELP2MAN], [help2man]) diff --git a/etc/completion/bash/herd b/etc/completion/bash/herd new file mode 100644 index 0000000..f006b86 --- /dev/null +++ b/etc/completion/bash/herd @@ -0,0 +1,100 @@ +# GNU Shepherd --- System service manager for GNU +# Copyright © 2023 Oleg Pykhalov +# +# This file is part of GNU Shepherd. +# +# GNU Shepherd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Shepherd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Shepherd. If not, see . + +# Bash completion for Shepherd commands. + +_herd_complete_subcommand() +{ + local command="${COMP_WORDS[1]}" + case "$command" in + discover) + mapfile -t COMPREPLY < <(compgen -W "guix-daemon" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + schedule) + mapfile -t COMPREPLY < <(compgen -W "mcron" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + set-http-proxy) + mapfile -t COMPREPLY < <(compgen -W "guix-daemon" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + *) + local services + services="$(herd status | grep '^ +\|^ -\| \*' | cut -d ' ' -f3)" + mapfile -t COMPREPLY < <(compgen -W "$services" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + esac +} + +_herd_complete_3() +{ + local command="${COMP_WORDS[2]}" + case "$command" in + guix-daemon) + complitions="on off" + mapfile -t COMPREPLY < <(compgen -W "$complitions" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + *) + ;; + esac +} + +_herd_is_command () +{ + local word + local result="false" + for word in "${COMP_WORDS[@]}" + do + if [ "$word" = "$1" ] + then + result=true + break + fi + done + $result +} + +_herd_complete() +{ + case $COMP_CWORD in + 1) + if [ -z "$_herd_subcommands" ] + then + # Cache the list of subcommands to speed things up. + _herd_subcommands_list=( + disable + discover + enable + schedule + set-http-proxy + start + status + stop + ) + _herd_subcommands="${_herd_subcommands_list[*]}" + fi + mapfile -t COMPREPLY < <(compgen -W "$_herd_subcommands" -- "${COMP_WORDS[$COMP_CWORD]}") + ;; + *) + case $COMP_CWORD in + 2) _herd_complete_subcommand;; + 3) _herd_complete_3;; + esac + ;; + esac +} + +complete -F _herd_complete herd -- 2.38.0 From unknown Sat Jun 21 05:08:43 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Oleg Pykhalov Subject: bug#63860: closed (Re: bug#63860: [PATCH] Shepherd: Add Bash completion file.) Message-ID: References: <873536jeuj.fsf_-_@gnu.org> <20230602221923.16196-1-go.wigust@gmail.com> X-Gnu-PR-Message: they-closed 63860 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 63860@debbugs.gnu.org Date: Mon, 05 Jun 2023 12:04:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1685966643-11478-1" This is a multi-part message in MIME format... ------------=_1685966643-11478-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #63860: [PATCH] Shepherd: Add Bash completion file. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 63860@debbugs.gnu.org. --=20 63860: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63860 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1685966643-11478-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 63860-done) by debbugs.gnu.org; 5 Jun 2023 12:03:44 +0000 Received: from localhost ([127.0.0.1]:48313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q68w3-0002y8-M3 for submit@debbugs.gnu.org; Mon, 05 Jun 2023 08:03:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q68w1-0002xi-KW for 63860-done@debbugs.gnu.org; Mon, 05 Jun 2023 08:03:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q68vw-0005xo-Da; Mon, 05 Jun 2023 08:03:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=39uzgMGquLIn8M7b89P+AryZ+Ia7HMgpkcS7ZOpv4ug=; b=hQA3Jm+UclLyW52FgW9f KgNmpz0aRa9Ykzzi7yfnn6fiyvwpnoqYPTp/B+paZgBBdF1l7QM9Hv4FGpBDxPIXWos9Sc7M+usBS qGU3vnb9Ckn2ieaXgkQHJEEZr/llwYjdA8PQHQ3Iid8bd6qv2kG36U+abAmn9l3OyNVA3zpnGJMfW 4PioHOjxQ32s3boKbAPip3uR5OOajS3F/9GfSh8PA/6UkP5OszFlmZBgd9j7yHwXLEQQUnVqRQMdj +Q5Ak3DatLYlPP4NePTS0qMxbJXSyf50cFWf9G9Dks9DBV2I3Fnj0OGthSK68is5TlP8n+CrS+qp9 LrMu8sX3IqJuDg==; Received: from [193.50.110.155] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q68vu-00070N-LL; Mon, 05 Jun 2023 08:03:36 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Oleg Pykhalov Subject: Re: bug#63860: [PATCH] Shepherd: Add Bash completion file. References: <940cd99ec2de7a9d6b6e0ea98670f0031891cdda.camel@gmail.com> <20230604085716.31735-1-go.wigust@gmail.com> Date: Mon, 05 Jun 2023 14:03:32 +0200 In-Reply-To: <20230604085716.31735-1-go.wigust@gmail.com> (Oleg Pykhalov's message of "Sun, 4 Jun 2023 11:57:16 +0300") Message-ID: <873536jeuj.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63860-done Cc: 63860-done@debbugs.gnu.org, Liliana Marie Prikler X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Oleg Pykhalov skribis: > * etc/completion/bash/herd: New file. > * Makefile.am (dist_bashcompletion_DATA): New variable. > * configure.ac: Add --with-bash-completion-dir. Excellent! Applied with the changes below. Thank you & thanks Liliana for reviewing! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/NEWS b/NEWS index d6c2fc0..b644adb 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,11 @@ Please send Shepherd bug reports to bug-guix@gnu.org. =20 * Changes in 0.10.2 =20 +** New Bash completion + +A Bash completion file is now installed, providing tab completion for the +=E2=80=98herd=E2=80=99 command. + ** =E2=80=98herd=E2=80=99 shows a hint when the service and action are lik= ely swapped =20 The hint is printed for instance when typing =E2=80=98herd foobar start=E2= =80=99. diff --git a/etc/completion/bash/herd b/etc/completion/bash/herd index f006b86..74e7a24 100644 --- a/etc/completion/bash/herd +++ b/etc/completion/bash/herd @@ -44,8 +44,8 @@ _herd_complete_3() local command=3D"${COMP_WORDS[2]}" case "$command" in guix-daemon) - complitions=3D"on off" - mapfile -t COMPREPLY < <(compgen -W "$complitions" -- "${COMP_= WORDS[$COMP_CWORD]}") + completions=3D"on off" + mapfile -t COMPREPLY < <(compgen -W "$completions" -- "${COMP_= WORDS[$COMP_CWORD]}") ;; *) ;; --=-=-=-- ------------=_1685966643-11478-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Jun 2023 22:19:55 +0000 Received: from localhost ([127.0.0.1]:40957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5D7i-0001Ly-KK for submit@debbugs.gnu.org; Fri, 02 Jun 2023 18:19:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:34136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5D7e-0001Lp-QU for submit@debbugs.gnu.org; Fri, 02 Jun 2023 18:19:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5D7e-00066S-HZ for guix-patches@gnu.org; Fri, 02 Jun 2023 18:19:50 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5D7c-0003nJ-Vk for guix-patches@gnu.org; Fri, 02 Jun 2023 18:19:50 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b035e94072so3515501fa.1 for ; Fri, 02 Jun 2023 15:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685744385; x=1688336385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=A+csw9nnfozvN8oPOSMVRefLXLn2+g9cyxvKIoHgF+U=; b=rTMU/uMpeELyROgS+Q+nNKpN/Q+hvjyyVkL49yj3B796g/WV6R8/bXh+3yBTJbaexf Z/pfshOrfpOxPb18epHZGhqY3WMYOK6zGyL08AYDH2zUhmXDo87Uh66j1yDP8hWHB0ov Ou4pS4jg+sLxx5IG9wRPPxXrEt3tFu40R9iTwsm5/KjrGqGmanJF6VnL4q7a9hgDZZ0s HrF7Q0O3eGJhleEzeBHmx5mSfj0i6Mt4PQ81N+U6fvxE59HhEqXAzWqLveC3FcgmtQuM xxanHgss9M7gZomfYK1FmsjT1Q1+m8xZUN/hlpK4IbOkOEhScTsQU0mOfFuINRDSE4Xn KwIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685744385; x=1688336385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A+csw9nnfozvN8oPOSMVRefLXLn2+g9cyxvKIoHgF+U=; b=eLkDPhpXvX3mrpdbe2i+Tk5RzossmLPPSqTn8h5QjO7P6+R48th16d7qjbsRdpRzO7 K1lEooXYSpX4LExPrYPH+P0K5KdeOWKFBIxOKjJNAGhrbsEPLefF8Pi8/KQ//sqscDOT rxtNsQRTgECkrJQ4ZoXgiFqrjpLBnqcROYLBEr/d40nUIxIENkd1CC8+TJ/sK7BgoM9f //tApQJScDYNV4EiiT1I0gnvuMChyiNhBinTXDk6j9bI3wOXuzlIfszVujKlF64oxmOz JOVwH+qR59i3fjyByV9pX6uzRqZVnqm7wDUxpNctFntVl6QgLAiBmyXkj7oxLhEUujp2 VLCA== X-Gm-Message-State: AC+VfDyJq/H5Y6LHASpiPbXSkVSdKChhiPYnh/fxC9KdR8HYXqE75ARu sWlyp5dl8Town2k/7hW9n83Tw8Zx1AY= X-Google-Smtp-Source: ACHHUZ5WXwJ0aF7VUjmphy7NoR/LfwejIHAKHfxKxqe3kB2DSPfsU91Mdj7qewn8DCYJ7R2v5ddsOQ== X-Received: by 2002:ac2:53b5:0:b0:4f3:ab2d:882d with SMTP id j21-20020ac253b5000000b004f3ab2d882dmr4981498lfh.4.1685744384949; Fri, 02 Jun 2023 15:19:44 -0700 (PDT) Received: from guixsd.wugi.info ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id y12-20020ac2446c000000b004f388c5f25dsm290661lfl.257.2023.06.02.15.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 15:19:44 -0700 (PDT) From: Oleg Pykhalov To: guix-patches@gnu.org Subject: [PATCH] Shepherd: Add Bash completion file. Date: Sat, 3 Jun 2023 01:19:23 +0300 Message-Id: <20230602221923.16196-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=go.wigust@gmail.com; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Oleg Pykhalov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This patch adds a Bash completion file discussed in the 45004 issue: awk replaced with grep and sed; added more Guix related subcommands; fixed typo with 't' letter in 'for word in ${COMP_WORDS[*]}t'. Tested with command: guix build -f guix.scm which produced: /gnu/store/hr4rqm9wi9i2fpcd75zpqfd04vqavyif-shepherd-0.10.99-git/etc/bash_completion.d/herd Oleg Pykhalov (1): Add Bash completion file. Makefile.am | 4 ++ configure.ac | 9 ++++ etc/completion/bash/herd | 104 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 etc/completion/bash/herd base-commit: b9b15db9e5bda27287706b6727c462df686e7621 -- 2.38.0 ------------=_1685966643-11478-1--