Giter VIP home page Giter VIP logo

bash_completion_defaultbrowser's Introduction

defaultbrowser Bash Completion

Bash completion for the defaultbrowser tool for MacOS

License: MIT

Introduction

The completion implementation requires defaultbrowser to be installed (of course), Tt uses the defaultbrowser built-in feature of listing all available browsers by not providing as$ argument.

$ defaultbrowser
  iterm2
* chrome
  firefoxdeveloperedition
  safari
  vlc
  evernote
  netnewswire

Usage

$ defaultbrowser <tab><tab>
chrome                   iterm2                   vlc
evernote                 netnewswire
firefoxdeveloperedition  safari

Download

$ curl https://raw.githubusercontent.com/jonasbn/bash_completion_defaultbrowser/master/defaultbrowser > defaultbrowser

Installation

When downloaded you have to install the completion implementation. Where your completions are located might vary.

Personal

If you want to install them for your personal use, do the following.

Create the file: ~/.bash_completion, containing the code below:

for bcfile in ~/.bash_completion.d/* ; do
  . $bcfile
done

Ref: ServerFault.com: Standard place for user defined bash_completion.d scripts?

Create a directory for your completions:

$ mkdir ~/.bash_completion.d

Copy your completions into the newly created directory:

$ cp defaultbrowser ~/.bash_completion.d/

Start a new shell and you should be good to go.

System-wide example from Debian

Based on an introduction to bash completions on Debian.

$ sudo cp defaultbrowser /etc/bash_completion.d/

System-wide example from OSX

This assumes you are using Homebrew

Do note that paths vary based on whether you are using bash 3 or 4

bash 3

Formula: bash-completions.

$ cp defaultbrowser /usr/local/etc/bash_completion.d/

And to activate right away:

$ source  /usr/local/etc/bash_completion.d/defaultbrowser

bash 4

Formula: bash-completions2.

$ cp defaultbrowser /usr/local/share/bash-completion/completions/

And to activate right away:

$ source /usr/local/share/bash-completion/completions/defaultbrowser

Motivation

I just discovered defaultbrowser today, since I needed a tool, which does exactly THAT - with this tab completion, it is even easier to use.

History

  • 1.0.0
    • Initial version working with defaultbrowser.

See Also

A more elaborate piece of documentation on bash completions is available from The Linux Documentation Project in the Advanced Bash-Scripting Guide.

From the GNU Documentation.

Good two-part article, "An Introduction to Bash Completion": Part 1 and Part 2.

Please note that this experimental implementation has only been tested with bash version 3 (see version 1.0.0).

Versions after version 1.0.0 have been tested with bash version 4.

The most comprehensive collection of bash completions I have come across is the one from the Debian Linux distribution. It is also the one offered for OSX via Homebrew.

References

License

This is made available under the MIT license, see separate license file.

Copyright

©️ jonasbn 2018

©️ defaultbrowser Margus Kerma, MIT License

bash_completion_defaultbrowser's People

Contributors

jonasbn avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bash_completion_defaultbrowser's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

None detected


  • Check this box to trigger a request for Renovate to run again on this repository

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.