brooklyncentral / brooklyn-bash-completion

A Bash auto-completion script for the br command
Apache License 2.0
0 stars 1 forks source link

Consider moving to brooklyn-client? #3

Open andreaturli opened 7 years ago

andreaturli commented 7 years ago

I think it would be great if we could move this to apache/brooklyn-client/cli for easier maintenance , publicity and also to easily achieve something like the following for homebrew users

  def install
    ENV["XC_OS"] = "darwin"
    ENV["XC_ARCH"] = MacOS.prefer_64_bit? ? "amd64" : "386"
    ENV["GOPATH"] = buildpath

    brooklyn_client_path = buildpath/"src/github.com/apache/brooklyn-client/"
    brooklyn_client_path.install Dir["*"]
    Language::Go.stage_deps resources, buildpath/"src"

    cd "src/github.com/apache/brooklyn-client/br" do
      system "go", "build"
      bin.install brooklyn_client_path/"br/br"
    end
    bash_completion.install "shell-completion/bash/br"
end

assuming we have a the br file in shell-completion/bash/. With that in place you should get a message like

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

when you install br cli with brew install apache-brooklyn-cli

cc @johnmccabe @grkvlt

johnmccabe commented 7 years ago

Sounds like a good idea to me 👍

Could also potentially roll it into the brew release on osx or add a new sub-command to initialise auto completion for you (br bash-autocomplete or some such).