Code Monkey home page Code Monkey logo

zsh-nft-completion's Introduction

NOTE: This completion script has been moved to https://github.com/zsh-users/zsh-completions . This means it will most likely be installable via your package manager. You can still open issues here but the fixes will be applied there.

nft completion for zsh

This is an attempt to create zsh command completion for nft (the nftables user space utility). As I'm neither an expert in nft nor an expert in zsh, this simply works but may seem awful to experts of these domains. So please help me make this a better utility by making constructive criticism ;) .

Currently implemented subcommands: all commands listed in the man page, except the content of the add commands (eg. add rule, add set, add map, etcpp) and delete element. I'm currently working on add rule.

how to install:

Generally you have to enable command completion first:

Then you have to copy _nft in a directory of you choice, for this example we choose ~/.zsh

And enable loading that completion function by adding ~/.zsh to fpath. This must happen before compinit or sourcing ohmyzsh.sh

fpath+=$HOME/.zsh

# source ohmyzsh.sh or autoload -Uz compinit

tips:

If you want to have your tables/chains/... completed when you are not a root user but using sudo, you have to add the following to your .zshrc :

zstyle ':completion::complete:*' gain-privileges 1

This will allow all completion scripts to search for completions with sudo if your command starts with sudo as well.

BUT: this also means that will allow (unchecked) scripts to run commands as sudo, so beware of the dangers!

zsh-nft-completion's People

Contributors

mqus avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

zggzcgy

zsh-nft-completion's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.