Code Monkey home page Code Monkey logo

openwrt-bash-completion's Introduction

openwrt-bash-completion

Bash completion script for OpenWrt make targets.

The purpose of this script is to save you from some typing when working with OpenWrt buildroot. Default completion for GNU Make distributed with Bash Completion is unable to discover all the targets that can be built by the buildroot. This script tries to improve this situation by searching for Makefiles in the buildroot and translating their paths to make targets. It can also parse the database of make targets and offer completion based on this output (see Mode Selection below).

Installation

To install this bash completion script it should be sufficient on most systems that have Bash Completion installed to copy openwrt_make to /etc/bash_completion.d/ or to add it to your .bashrc file.

Mode Selection

openwrt-bash-completion can work in two modes. Default mode is completion based on Makefile discovery, where relevant parts of the buildroot are searched for existing Makefiles and their paths are translated into names of make targets. This mode is faster and does not need to run the make command. However not all targets can be discovered in this mode - mainly host-build targets and some subtargets of toolchain.

Second mode of operation is completion based on output of make printdb command. This can be enabled by setting OPENWRT_COMPL_USE_PRINTDB=1 in the current Bash session or in your .bashrc file. In this mode, most (if not all) targets can be found, however it's not as fast as the default target discovery. This problem is solved by caching of the parsed output to OPENWRT_COMPL_CACHE variable if OPENWRT_COMPL_CACHE_PRINTDB is set to 1 (default value). Please note that this cache must be cleared if the package definitions changed (some packages or target definitions were added). This can be achieved either by restarting of the Bash session or simply by running OPENWRT_COMPL_CACHE=.

License & Contributing

This script is released under the MIT license. Any contributions or suggestions for improvement are appreciated.

openwrt-bash-completion's People

Contributors

sairon avatar

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.