Skip to content

Generate bash autocompletion for any command you pass along to it

Notifications You must be signed in to change notification settings

liloman/generate-autocompletion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Generate-autocompletion

Generate automagically bash autocompletion for any command that admits the gnu long option --help.

##Quick Start

git clone https://github.com/liloman/generate-autocompletion
cd generate-autocompletion
./generate-autocompletion stat
source ~/.local/share/bash-completion/completions/stat

Screencast

##Install

Copy/soft link generate-autocompletion.sh into .local/bin and update your .bashrc/.bash_profile/... accordingly.

##Tests

You can run tests using Bats.

[[ -f /etc/lsb-release ]] && bats test/ubuntu.bats
[[ -f /etc/fedora-release ]] && bats test/fedora.bats

Should output something like:

➬bats tests/fedora.bats
✓ command without arguments
✓ command without options/verbs
✓ command without software
✓ command with standalone options only
✓ command with both options 
✓ command with both options 2
✓ command with verbs 1
✓ command with verbs 2
✓ command with verbs 3
✓ command without autocompletion already

10 tests, 0 failures

##TODO

  • Implement something like zsh auto fu with bash simple curses or via bash plugin (ctypes.sh way)
  • Recheck results against man pages also to detect false positives
  • Able to parse commands like cpupower with "old output style"

About

Generate bash autocompletion for any command you pass along to it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages