From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oOiPMkCVyl+7bwAA0tVLHw (envelope-from ) for ; Fri, 04 Dec 2020 20:00:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id cFeCLkCVyl9PdQAA1q6Kng (envelope-from ) for ; Fri, 04 Dec 2020 20:00:00 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2F3E39400D3 for ; Fri, 4 Dec 2020 20:00:00 +0000 (UTC) Received: from localhost ([::1]:46062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1klHFG-0006HN-SN for larch@yhetil.org; Fri, 04 Dec 2020 14:59:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klEjx-00007X-3N for guix-patches@gnu.org; Fri, 04 Dec 2020 12:19:50 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1klEjW-00019d-0s for guix-patches@gnu.org; Fri, 04 Dec 2020 12:19:16 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1klEjV-0005UR-Rq for guix-patches@gnu.org; Fri, 04 Dec 2020 12:19:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45004] [PATCH shepherd] herd: Suggest alternatives when action and service are likely swapped. Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 04 Dec 2020 17:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45004 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jonathan Brielmaier Cc: 45004@debbugs.gnu.org Received: via spool by 45004-submit@debbugs.gnu.org id=B45004.160710233821093 (code B ref 45004); Fri, 04 Dec 2020 17:19:01 +0000 Received: (at 45004) by debbugs.gnu.org; 4 Dec 2020 17:18:58 +0000 Received: from localhost ([127.0.0.1]:45510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klEjR-0005U8-Nr for submit@debbugs.gnu.org; Fri, 04 Dec 2020 12:18:58 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klEjO-0005Tt-5o for 45004@debbugs.gnu.org; Fri, 04 Dec 2020 12:18:56 -0500 Received: by mail-lj1-f195.google.com with SMTP id r18so7469397ljc.2 for <45004@debbugs.gnu.org>; Fri, 04 Dec 2020 09:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MSlDx7blVlTbYJCmWa7UOFETdt+AM0MZOhdlsYzwbi0=; b=GsKxqmdfVi7kI4K2QtjQg5DZ4X8LBpXw/VxjEB+2CyipRVbeDYwrvarjmyHCPKVMF4 SJtj6sK2flIKwnP548fxexoxT/qnw8uj+bliMdSPNYn9pNA1GTz1Q5D0v0MS0tSZQeQa nLO0akQ5fhNvW7gKm1ketPMLEtBJYoBa9dpj3Gja9y0o08QDGmIxoskD/hA1JrlSBgmv OtJjb6kbM9F9AP8VZp+tvHX/lwuIFZydupudnjUeyM24fqNj2RdW3SK7o72puvqi36G9 euNFollbtcYMQ+kH7Jv8SsWIILZfu6IFoJgGnueDJppWvCNrq2y/m5Qkbs9gME/NeFwh UqoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=MSlDx7blVlTbYJCmWa7UOFETdt+AM0MZOhdlsYzwbi0=; b=hROHEsaDYUdH3wKKZEx+s76YWQXYx2zUz+rxqnRdNtnbvTXJCiXJPupXrXlqQ8b+op zAs631UtVleQeZCCHxGMfV5gI5TeN5iYmsvzn7mdqg6RxxErljyAcq2BQ4eefV77Iuur BMB01Lvd9POZjYSuDjn10mzDnuSnYLAaZmcwL5pCLcZUVY2XghLs6o2V4iuO4p8nnAmk EdjaU01oQ0QhQSW46fp3dLK29//IycmqdVFXzdbEJKcAp1bwVqaI30aoyTXZi/+4ChGi hhamxX1n3rzMO1sRyvfcFLdzx/cbCaeSjh4Atsqrhr5OEnZITGTpWgkDsoQIWlNrlAWg 2zZg== X-Gm-Message-State: AOAM533Etr+Ua6eDg5lSuQ6I2juzlbOx8K5/cr8Y7S/X1QaWFJNnwah+ m/q2Kgw+MV2XeNuf6FYO+3wbqK9mdFA= X-Google-Smtp-Source: ABdhPJxhDAAhsuvkfTn9L/e66u28jgKTJd9iowmcvwN/12rm1FWuD1pl8PvtvtYw4ctRub1dNwnghw== X-Received: by 2002:a2e:8115:: with SMTP id d21mr3706564ljg.379.1607102327830; Fri, 04 Dec 2020 09:18:47 -0800 (PST) Received: from guixsd ([178.71.226.25]) by smtp.gmail.com with ESMTPSA id x8sm1856753lfq.143.2020.12.04.09.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 09:18:45 -0800 (PST) From: Oleg Pykhalov References: <20201202092106.22770-1-leo.prikler@student.tugraz.at> Date: Fri, 04 Dec 2020 20:18:41 +0300 In-Reply-To: (Jonathan Brielmaier's message of "Wed, 2 Dec 2020 21:03:54 +0100") Message-ID: <87a6utqyku.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.29 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=GsKxqmdf; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 2F3E39400D3 X-Spam-Score: -3.29 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: F9IyvMxJi55C --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jonathan Brielmaier writes: [=E2=80=A6] > It reminds me that I should maybe write bash completions files for > shepherd as it annoys me pretty hard ^^ You could take my, which probably should be improved before merging to Shepherd IMHO, e.g. avoid 'awk'. ~/.local/share/bash-completion/completions/herd --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=herd Content-Description: herd completion _herd_complete_service(){ local command="${COMP_WORDS[1]}" local services="$(sudo herd status | awk '/*/ || /^ +/ || /^ -/ { print $NF }' | sort -u)" COMPREPLY=($(compgen -W "$services" -- "${COMP_WORDS[$COMP_CWORD]}")) } _herd_is_command () { local word local result="false" for word in ${COMP_WORDS[*]}t 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="enable disable start status stop" fi COMPREPLY=($(compgen -W "$_herd_subcommands" -- "${COMP_WORDS[$COMP_CWORD]}")) ;; *) case $COMP_CWORD in 2) _herd_complete_service;; esac ;; esac } complete -F _herd_complete herd --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAl/Kb3IUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pyufhAAhJce5fa8tK3aO/dzrXaD7pu4B6Ig 59gSYTIjPOojLT2r7WqOeBLwIw1opQrRdKF9p5b5vxrnaAcB8amJobzNKTyVSP3f uHvAelAU/bv3BUHobOpZA+VxQJkK928pQRi2IKsvCh87GZ31PdevxOTWCkb74VRP p4azpvdz7vsO4sAq6KJPGo+Mfpo2U4BWxFgif9yPP3Gv9dVEYcHCL/3i1rtuUdvB PK/iFUvKoxzZLd/hMRtUvfPiyc+l57Mlhb8P0gIiWF7/dmLtVx+X85hTrMx8r71Z VRODRxEz5aOM3uQbWYyV4PzqTWfJueWuxj81AYhPFHAeQSyrbeDng+wM1cg1nDI5 JTMkEBr4kdOLw58EdSa+JE6M2erLHG4WTnbbIaAXAKdVKOdgSwq0hP1CEqsnKfVs qaP2OO9+UciB4DaqPr+dS1B1gbUGMW0q4dLylQoYuNAi7YWbHFBCPCDCK0YUfH1E QYBnk7wDdNaGus3LBj4/1geqjUHzfziUjvt7FLlPd9kPLlfEuJgAoPM+nVm+DkJS XlDT3L9VpmOBLQTZWYemXTqi6wpf6HJKl3vR/vDU/BrokpZjgpPBcnbGlnQ/UlwM ziUC36KNh6lG6D6IPDtwzg/zTv/HKAnyHc+feYjaZFGijMDUYPDJ6UUGoFgJV/ii UWmoxzacE2YrUcU= =MTyf -----END PGP SIGNATURE----- --==-=-=--