Git Product home page Git Product logo

ansible-completion's People

Contributors

ajaxodessa avatar chusiang avatar denkoren avatar dysosmus avatar gusttt avatar hryamzik avatar ogarcia avatar perlun avatar pheanex avatar robinoburka avatar wolfgangkarall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-completion's Issues

Completions for other binaries?

There are a few more ansible tools. Namely:

  • ansible-doc
  • ansible-galaxy
  • ansible-playbook
  • ansible-pull
  • ansible-vault

Would you like to implement completion for those as well in this repo or at least accept pull-requests?

Linux support

It writen only for freebsd?
In linux md5->md5sum and other keys to stat.
It work on linux whith -

@@ -86 +86 @@
-    local hash_module_path=$(md5 -q -s "$module_path")
+    local hash_module_path=$(echo "$module_path" | md5sum |awk {'print $1'})
@@ -116 +117 @@
-    echo $(stat -f "%Sm" -t "%s" $1)
+    echo $(stat -c "%Z" $1)

Obsolete installation instructions

In the readme the step 2 tells:

  1. Copy/move the ansible-completion.bash in your bash_completion.d
    folder (/etc/bash_completion.d, /usr/local/etc/bash_completion.dor ~/bash_completion.d).

But that path does not exist anymore. See https://archlinux.org/todo/use-usrsharebash-completioncompletions-for-package-bash-completions/

Instead, I think each *-completion.bash file except ansible-completion.bash should source the common one. I.e. include the following line after shebang:
source /usr/share/bash-completion/completions/ansible

overwrite module-name tmp file

If enable -
set -o noclobber
it have errors like

ansible myhost -m bash: /tmp/25576.module-name.ansible.completion: cannot overwrite existing file

As variant it fixed -

-    local cache_file=/tmp/${$}.${module_path:+"$hash_module_path".}module-name.ansible.completion 
+    # /tmp/<pid>.<hash of the module path if exsist>.module-name.ansible.completion and time for set -o noclobber
+    local cache_file=/tmp/${$}.$(date +%s).${module_path:+"$hash_module_path".}module-name.ansible.completion 

And it work, but it doesnt good solution, i think -

find /tmp/ -name "*.completion" 
/tmp/25576.1399165774.module-name.ansible.completion
/tmp/25576.1399165789.module-name.ansible.completion
/tmp/25576.1399165767.module-name.ansible.completion
/tmp/25576.module-name.ansible.completion
/tmp/25576.1399165783.module-name.ansible.completion
/tmp/25576.1399165770.module-name.ansible.completion

Dir `~/bash_completion` is not automatically loaded, File `~/.bash_completion` is.

I wanted to point out that the installation steps for a user-defined bash completion

A) direct users to make a non hidden directory for thier user configuration, which breaks the norm and
B) doesn't actually get autoloaded by the bash shell.

However, according to http://serverfault.com/q/506612/210994

a user can make a file ~/.bash_completion and append to that file with the completions they want.

Or even better, make a directory ~/.bash_completion.d/ and populate the ~/.bash_completion file with the body:

~/.bash_completion
#!/usr/bin/env bash

if [ -d "$HOME/.bash_completion.d" ]; then
    for filename in "$HOME/.bash_completion.d/*"; do
        source $filename
    done
fi

Any file placed in ~/.bash_completion.d/ will be loaded.

This utilizes the existing bash autoload, And leaves the config files as hidden files to follow precedent.

Status of this project

Hello. Thanks for this project.
Seems like this project is completely separate and unofficial. Could be this mentioned in the readme?

Also, how it differs from the python-argcomplete method, described in official documentation here? Could this be mentioned in readme too?

Scope of this project

Hi,
I wanted to learn about bash completion by writing something like this, for ansible-playbook.
In particular, I wanted to make it so, that when you provide a parameter for the inventory, for example -i inventory/my-inventory and then you add the --limit parameter, it would complete the possible parameter values according to what is in that inventory.
Would you consider that a suitable addition?
Not sure how hard it is though... ;)

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.