Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Bash completion of aliased commands

  1. #11
    Join Date
    Jul 2012
    Beans
    7

    Re: Bash completion of aliased commands

    HELP! i',m sorry for reviving this old post, but this isn't (entirely) working for me!

    Here is my output of "complete -p apt-get":
    bash: complete: apt-get: no hay completado de especificación
    (in english it would be "bash:complete: apt-get: no completion specification")

    BUT when i do "apt-get <tab> <tab>" i still get the autocompletion feature. IN FACT, when i "complete -p apt-get" after that, i get "complete -F _apt_get apt-get"

    Then, my alias do autocomplete, but if i close that terminal, it does not do that anymore..

    any clues?

  2. #12
    Join Date
    Jan 2008
    Beans
    8

    Re: Bash completion of aliased commands

    Yes, this behavior also exists for apt-cache. It seems the function for bash completion only gets created at the first "apt-cache <tab>".
    So I had to integrate this code in my alias completion code:

    [ ! -f /usr/share/bash-completion/completions/apt-cache ] || source /usr/share/bash-completion/completions/apt-cache
    The code you need is this:
    [ ! -f /usr/share/bash-completion/completions/apt-get ] || source /usr/share/bash-completion/completions/apt-get
    Call this before you call "complete -F".

  3. #13
    Join Date
    Jul 2012
    Beans
    7

    Re: Bash completion of aliased commands

    Thank you very much!!!

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •