madsmith / bash-completion-lib

Automatically exported from code.google.com/p/bash-completion-lib
GNU General Public License v2.0
0 stars 0 forks source link

Add -f flag to force loading completions #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Especially during development, it would be nice to have an additional flag
-f when invoking bash_completion_lib:

    . bash_completion_lib -f

This -f flag should let bash_completion_lib *really* load completions (looping
through $COMP_PATH) instead of exitting prematurely in case $COMP_VERSION or
$COMP_CACHE is set.

Flow diagram:

                     V                                               
                     |                                               
                     +--------------->--------------\    +---------+,
                     |                               \   | In case +-+
          /----------+-----------\                    \ /| of -f     |
     yes /   bash_completion_lib  \  no                X +-----------+
   +-----      already loaded?     ------+              \
   |     \  ($COMP_VERSION set?)  /      |               \
   |      \----------------------/       |                \
   |                                     |                 \
   |                               /-----+------\           \
   |                          yes /  Use cache?  \  no       \
   |                        +-----  ($COMP_CACHE  -----+      |
   |                        |     \     set?)    /     |      |
   |                        |      \------------/      |      v
   |                        |                          |      |
   |                        |              +-----------+------+--------+
   |                    load cache         |     load completions      |
   |                        |              | (Loop through $COMP_PATH) |
   |                        |              +-----------+---------------+
   |                        |                          |
   |                        +------------+-------------+  
   |                                     |                
   +-----------------+-------------------+                
                     |                                    
                     +-->                                 

Original issue reported on code.google.com by fvu...@gmail.com on 10 Oct 2008 at 7:16