summaryrefslogtreecommitdiff
path: root/docs/source/complete.rst
diff options
context:
space:
mode:
authorRyan Petrello <lists@ryanpetrello.com>2015-05-06 10:17:30 -0400
committerRyan Petrello <lists@ryanpetrello.com>2015-05-06 10:17:56 -0400
commitca2e90a94031fdbba31bf4bda87b51a87e97eb7c (patch)
treefb7475ce51ddc4d8807900553d52eff682fe4f9e /docs/source/complete.rst
parent79a8791e7fefdcbe62f264bf905ac09a1958e753 (diff)
downloadcliff-master.tar.gz
Cliff has moved to the `openstack` namespace. Update README.HEADmaster
Diffstat (limited to 'docs/source/complete.rst')
-rw-r--r--docs/source/complete.rst45
1 files changed, 0 insertions, 45 deletions
diff --git a/docs/source/complete.rst b/docs/source/complete.rst
deleted file mode 100644
index 2a08098..0000000
--- a/docs/source/complete.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-====================
- Command Completion
-====================
-
-A generic command completion command is available to generate a
-bash-completion script. Currently, the command will generate a script
-for bash versions 3 or 4. There is also a mode that generates only
-data that can be used in your own script. The command completion script
-is generated based on the commands and options that you have specified
-in cliff.
-
-Usage
-=====
-
-In order for your command to support command completions, you need to
-add the `cliff.complete.CompleteCommand` class to your command manager.
-
-::
-
- self.command_manager.add_command('complete', cliff.complete.CompleteCommand)
-
-When you run the command, it will generate a bash-completion script:
-
-::
-
- (.venv)$ mycmd complete
- _mycmd()
- {
- local cur prev words
- COMPREPLY=()
- _get_comp_words_by_ref -n : cur prev words
-
- # Command data:
- cmds='agent aggregate backup'
- cmds_agent='--name'
- ...
- if [ -z "${completed}" ] ; then
- COMPREPLY=( $( compgen -f -- "$cur" ) $( compgen -d -- "$cur" ) )
- else
- COMPREPLY=( $(compgen -W "${completed}" -- ${cur}) )
- fi
- return 0
- }
- complete -F _mycmd mycmd
-