From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13463 invoked from network); 20 Oct 2021 18:49:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Oct 2021 18:49:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=iFwe/GH9QHhS55cxVvG9x2erzqnjICwTE9QT9nQtPAk=; b=XXOFriyiP0Ed7s+MMLh7lxhqjw htK7EWALVzuIHxE3NDXUlOIeiNhnvJV0UTxviqEtFfb8ryoX6IvYtS7JlB7pGOpVZqnb33h1ddLlk pWrkc/wmf3W8K7XG02gWa7gVvhoMZVfBixPxOU7jh3DCXZYo6xh2YtbB09fEJuNYEgzNreK0HfL/J GkNfkryC8/cXcjSsLugHmCKrC+PRGyQGtO45k+lQPg3BgJt5OEF3lRnyGEVusP6gul4z2dmed6qu/ eKxEPVa9lBEJkteKdG77XtWk7TwCqqcQrXJYGYF2sAWnlIrab/VdTumHWuDSlX4MsjxdnWU4LGdvZ Hye+o4yA==; Received: from authenticated user by zero.zsh.org with local id 1mdGeS-0009gt-FW; Wed, 20 Oct 2021 18:49:24 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mdGdx-0009PU-Qv; Wed, 20 Oct 2021 18:48:54 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1mdGdx-00004p-Bo for zsh-workers@zsh.org; Wed, 20 Oct 2021 20:48:53 +0200 From: Oliver Kiddle To: Zsh workers Subject: PATCH: lsns completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <297.1634755733.1@hydra> Date: Wed, 20 Oct 2021 20:48:53 +0200 Message-ID: <298-1634755733.362351@8oWD.3ryx.YSGy> X-Seq: 49500 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: This is a new completion for util-linux's lsns command. We could call it to get namespaces to complete. But it is mostly useful to specify them by pid with -p anyway and they are just big numbers. Oliver diff --git a/Completion/Linux/Command/_lsns b/Completion/Linux/Command/_lsns new file mode 100644 index 000000000..994101d97 --- /dev/null +++ b/Completion/Linux/Command/_lsns @@ -0,0 +1,18 @@ +#compdef lsns + +local ign + +(( $#words > 2 )) && ign='!' +_arguments -s -S \ + '(-J --json)'{-J,--json}'[use JSON output format]' \ + '(-l --list)'{-l,--list}'[use list format output]' \ + '(-n --noheadings)'{-n,--noheadings}"[don't print headings]" \ + '(-o --output)'{-o,--output}'[define which output columns to use]:column:_sequence compadd -M "m\:{a-z}={A-Z}" - NS TYPE PATH NPROCS PID PPID COMMAND UID USER NETNSID NSFS' \ + '(-p --task)'{-p+,--task=}'[print process namespaces]:process id:_pids' \ + '(-r --raw)'{-r,--raw}'[use the raw output format]' \ + '(-u --notruncate)'{-u,--notruncate}"[don't truncate text in columns]" \ + '(-W --nowrap)'{-W,--nowrap}"[don't use multi-line representation]" \ + '(-t --type)'{-t+,--type=}'[filter by namespace type]:namespace type:(mnt net ipc user pid uts cgroup)' \ + "$ign(- *)"{-h,--help}'[display usage information]' \ + "$ign(- *)"{-V,--version}'[display version information]' \ + '*: :_guard "^-*" namespace'