All Projects → JoshMcguigan → Shell_completion

JoshMcguigan / Shell_completion

Licence: other
Write shell completion scripts in pure Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Shell completion

Csp Auditor
Burp and ZAP plugin to analyse Content-Security-Policy headers or generate template CSP configuration from crawling a Website
Stars: ✭ 121 (-0.82%)
Mutual labels:  hacktoberfest
Puppet Mcollective
MCollective Server and Client Puppet Module
Stars: ✭ 121 (-0.82%)
Mutual labels:  hacktoberfest
Rustc codegen gcc
libgccjit AOT codegen for rustc
Stars: ✭ 116 (-4.92%)
Mutual labels:  hacktoberfest
Downlords Faf Client
Official client for Forged Alliance Forever
Stars: ✭ 121 (-0.82%)
Mutual labels:  hacktoberfest
Ysi Includes
Just the YSI include files, none of the extra stuff.
Stars: ✭ 122 (+0%)
Mutual labels:  hacktoberfest
Okteto
Develop your applications directly in your Kubernetes Cluster
Stars: ✭ 1,937 (+1487.7%)
Mutual labels:  hacktoberfest
Hubspot3
python3.5+ hubspot client based on hapipy, but modified to use the newer endpoints and non-legacy python
Stars: ✭ 121 (-0.82%)
Mutual labels:  hacktoberfest
Commandblocks
Mindustry Command Mod: A highly utilitarian mod with fun and useful blocks such as Command Blocks, Dash Panels and Pistons; New features such as Skills; And an upcoming new Gamemode!
Stars: ✭ 123 (+0.82%)
Mutual labels:  hacktoberfest
Pyorbital
Orbital and astronomy computations in python
Stars: ✭ 119 (-2.46%)
Mutual labels:  hacktoberfest
Tobab
tobab: the poor mans identity aware proxy, easy to use setup for beyondcorp in your homelab
Stars: ✭ 122 (+0%)
Mutual labels:  hacktoberfest
Csharp Mode
A major-mode for editing C# in emacs
Stars: ✭ 121 (-0.82%)
Mutual labels:  hacktoberfest
Eventum
Eventum Issue Tracking System
Stars: ✭ 120 (-1.64%)
Mutual labels:  hacktoberfest
Defold
Defold is a completely free to use game engine for development of desktop, mobile and web games.
Stars: ✭ 1,938 (+1488.52%)
Mutual labels:  hacktoberfest
Geoext3
A JavaScript framework that combines the GIS functionality of OpenLayers with all features of the ExtJS library
Stars: ✭ 121 (-0.82%)
Mutual labels:  hacktoberfest
Gamedev4noobs
Olá, sejam bem-vindos ao repositório _gamedev4noobs_ do Estúdio Vaca Roxa. O propósito desse repositório, além de contribuir para o projeto 4noobs, é ensinar o básico do desenvolvimento de jogos para iniciantes. Apresentando boas práticas e insumos para criar games incríveis.
Stars: ✭ 122 (+0%)
Mutual labels:  hacktoberfest
Mapswipe
MapSwipe mobile application
Stars: ✭ 121 (-0.82%)
Mutual labels:  hacktoberfest
Across Tabs
Easy communication between cross-origin browser tabs. Simplified "CORS"ing!
Stars: ✭ 1,575 (+1190.98%)
Mutual labels:  hacktoberfest
Cluster.dev
Kubernetes-based Dev Environments with GitOps
Stars: ✭ 122 (+0%)
Mutual labels:  hacktoberfest
Aws Faq
Stars: ✭ 122 (+0%)
Mutual labels:  hacktoberfest
Inav
INAV: Navigation-enabled flight control software
Stars: ✭ 1,830 (+1400%)
Mutual labels:  hacktoberfest

shell_completion Build Status crates.io badge

Shell completions, which provide auto-complete for CLI applications, are typically written in Bash. This crate provides low level primitives for writing shell completion scripts in Rust.

Usage

Shell completion scripts are written as normal Rust binaries. A minimal example is below:

use shell_completion::{BashCompletionInput, CompletionInput, CompletionSet};

fn main() {
    let input = BashCompletionInput::from_env()
        .expect("Missing expected environment variables");

    let completions = input.complete_subcommand(vec!["add", "commit"]);

    completions.suggest();
}

A more advanced example is available in the cargo_completion crate within this workspace. To try it out, run cargo install --force --path cargo_completion/ && complete -C _cargo_completion cargo, then type cargo run --<TAB> in the same shell.

The complete command registered our shell completion script for cargo. Note that complete commands do not persist (they are only active in the shell where you run complete), so if you want to use a completion long term you'll want to add the complete command to your ~/.bash_profile.

See this blog post for more details.

Users

This crate is not quite ready for production use, but if you are an early adopter, feel free to make a PR adding yourself to the list below.

  • N/A

License

Licensed under either of

at your option.

Contribution

All forms of contribution are valued. I've created issues for many high level topics of exploration, and any feedback there will be very helpful in moving this crate in the right direction. Of course, code contributions are appreciated as well.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].