Commit 9f5c61b7034983088e54425bed56bf69e7ab61e1

Authored by mj
1 parent c1f898c545
Exists in master and in 2 other branches 02-merge, dev

Squashed 'repos/robbyrussell/oh-my-zsh/' changes from e55c715..75b9030

75b9030 Merge pull request #3731 from NHDaly/patch-1
8301040 Merge pull request #3683 from jameswomack/fix_3640
d4918ae Fixed Typo.
1b6af54 Merge pull request #3692 from XerWandeRer/master
b28abd5 Merge pull request #3694 from houjunchen/django
0dde994 [Modify] Update django.plugin.zsh for Django 1.7.6
a414b5e Update _adb
c58c623 Use camelCase for npm aliases

git-subtree-dir: repos/robbyrussell/oh-my-zsh
git-subtree-split: 75b9030f48a55a42849cc68b0fc5b92d66d236ac

Showing 4 changed files with 225 additions and 56 deletions Inline Diff

1 ![Oh My Zsh](https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png) 1 ![Oh My Zsh](https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png)
2 2
3 3
4 Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again. 4 Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again.
5 5
6 __Oh My Zsh is a way of life!__ Once installed, your terminal prompt will become the talk of the town _or your money back!_ Each time you interace with your command prompt, you'll be able take advantage of the hundreds of bundled plugins and pretty themes. Strangers will come up to you in cafés and ask you, _"that is amazing. are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you always felt that you deserved. ...or maybe you'll just use the time that you saved to start flossing more often. 6 __Oh My Zsh is a way of life!__ Once installed, your terminal prompt will become the talk of the town _or your money back!_ Each time you interface with your command prompt, you'll be able take advantage of the hundreds of bundled plugins and pretty themes. Strangers will come up to you in cafés and ask you, _"that is amazing. are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you always felt that you deserved. ...or maybe you'll just use the time that you saved to start flossing more often.
7 7
8 To learn more, visit http://ohmyz.sh and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on twitter. 8 To learn more, visit http://ohmyz.sh and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on twitter.
9 9
10 ## Getting Started 10 ## Getting Started
11 11
12 12
13 ### Prerequisites 13 ### Prerequisites
14 14
15 __Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._ 15 __Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._
16 16
17 * Unix-based operating system (Mac OS X or Linux) 17 * Unix-based operating system (Mac OS X or Linux)
18 * [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent) 18 * [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent)
19 * This is commonly pre-installed. (`zsh --version` to confirm) 19 * This is commonly pre-installed. (`zsh --version` to confirm)
20 * `curl` or `wget` should be installed 20 * `curl` or `wget` should be installed
21 21
22 ### Basic Installation 22 ### Basic Installation
23 23
24 Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either `curl` or `wget`. 24 Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either `curl` or `wget`.
25 25
26 #### via curl 26 #### via curl
27 27
28 `curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh` 28 `curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh`
29 29
30 #### via wget 30 #### via wget
31 31
32 `wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh` 32 `wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh`
33 33
34 ## Using Oh My Zsh 34 ## Using Oh My Zsh
35 35
36 ### Plugins 36 ### Plugins
37 37
38 Oh My Zsh comes with a shit load of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available. 38 Oh My Zsh comes with a shit load of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available.
39 39
40 #### Enabling Plugins 40 #### Enabling Plugins
41 41
42 If you spot a plugin (or several) that you would like to use with Oh My Zsh, you will need to edit the `~/.zshrc` file. Once you open it with your favorite editor, you'll see a spot to list all the plugins that you'd like Oh My Zsh to load in initialization. 42 If you spot a plugin (or several) that you would like to use with Oh My Zsh, you will need to edit the `~/.zshrc` file. Once you open it with your favorite editor, you'll see a spot to list all the plugins that you'd like Oh My Zsh to load in initialization.
43 43
44 For example, this line might begin to look like... 44 For example, this line might begin to look like...
45 45
46 `plugins=(git bundler osx rake ruby)` 46 `plugins=(git bundler osx rake ruby)`
47 47
48 #### Using Plugins 48 #### Using Plugins
49 49
50 Most plugins (should! we're working on this) include a __README__, which documents how to use them. 50 Most plugins (should! we're working on this) include a __README__, which documents how to use them.
51 51
52 ### Themes 52 ### Themes
53 53
54 We'll admit it. Early in the Oh My Zsh world... we may have gotten a far too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out! 54 We'll admit it. Early in the Oh My Zsh world... we may have gotten a far too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out!
55 55
56 #### Selecting a Theme 56 #### Selecting a Theme
57 57
58 _Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just right (for him)._ 58 _Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just right (for him)._
59 59
60 Once you find a theme that you want to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like: 60 Once you find a theme that you want to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like:
61 61
62 `ZSH_THEME="robbyrussell"` 62 `ZSH_THEME="robbyrussell"`
63 63
64 To use a different theme, simple change the value to match the name of your desired theme. For example: 64 To use a different theme, simple change the value to match the name of your desired theme. For example:
65 65
66 `ZSH_THEME="agnoster"` (this is one of the fancy ones) 66 `ZSH_THEME="agnoster"` (this is one of the fancy ones)
67 67
68 Open up a new terminal window and your prompt should look something like... 68 Open up a new terminal window and your prompt should look something like...
69 69
70 ## Advanced Topics 70 ## Advanced Topics
71 71
72 If you're the type that likes to get their hands dirty... these sections might resonate. 72 If you're the type that likes to get their hands dirty... these sections might resonate.
73 73
74 ### Advanced Installation 74 ### Advanced Installation
75 75
76 For those who want to install this manually and/or set custom paths. 76 For those who want to install this manually and/or set custom paths.
77 77
78 #### Custom Directory 78 #### Custom Directory
79 79
80 The default location is `~/.oh-my-zsh` (hidden in your home directory) 80 The default location is `~/.oh-my-zsh` (hidden in your home directory)
81 81
82 If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this: 82 If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:
83 83
84 `curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh` 84 `curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh`
85 85
86 #### Manual Installation 86 #### Manual Installation
87 87
88 ##### 1. Clone the repository: 88 ##### 1. Clone the repository:
89 89
90 `git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh` 90 `git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh`
91 91
92 ##### 2. *Optionally*, backup your existing @~/.zshrc@ file: 92 ##### 2. *Optionally*, backup your existing @~/.zshrc@ file:
93 93
94 `cp ~/.zshrc ~/.zshrc.orig` 94 `cp ~/.zshrc ~/.zshrc.orig`
95 95
96 ##### 3. Create a new zsh configuration file 96 ##### 3. Create a new zsh configuration file
97 97
98 You can create a new zsh config file by copying the template that we included for you. 98 You can create a new zsh config file by copying the template that we included for you.
99 99
100 `cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc` 100 `cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc`
101 101
102 ##### 4. Change your default shell 102 ##### 4. Change your default shell
103 103
104 `chsh -s /bin/zsh` 104 `chsh -s /bin/zsh`
105 105
106 ##### 5. Initialize your new zsh configuration 106 ##### 5. Initialize your new zsh configuration
107 107
108 Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration. 108 Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration.
109 109
110 ### Installation Problems 110 ### Installation Problems
111 111
112 If you have any hiccups installing, here are a few common fixes. 112 If you have any hiccups installing, here are a few common fixes.
113 113
114 * You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`. 114 * You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`.
115 * If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`. 115 * If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`.
116 116
117 ### Custom Plugins and Themes 117 ### Custom Plugins and Themes
118 118
119 If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/` directory. 119 If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/` directory.
120 120
121 If you have many functions that go well together, you can put them as a `abcyzeae.plugin.zsh` file in the `custom/plugins/` directory and then enable this plugin. 121 If you have many functions that go well together, you can put them as a `abcyzeae.plugin.zsh` file in the `custom/plugins/` directory and then enable this plugin.
122 122
123 If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`. 123 If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`.
124 124
125 ## Getting Updates 125 ## Getting Updates
126 126
127 By default, you will be prompted to check for upgrades every few weeks. If you would like `oh-my-zsh` to automatically upgrade itself without prompting you, set the following in your `~/.zshrc`: 127 By default, you will be prompted to check for upgrades every few weeks. If you would like `oh-my-zsh` to automatically upgrade itself without prompting you, set the following in your `~/.zshrc`:
128 128
129 `DISABLE_UPDATE_PROMPT=true` 129 `DISABLE_UPDATE_PROMPT=true`
130 130
131 To disable automatic upgrades, set the following in your `~/.zshrc`: 131 To disable automatic upgrades, set the following in your `~/.zshrc`:
132 132
133 `DISABLE_AUTO_UPDATE=true` 133 `DISABLE_AUTO_UPDATE=true`
134 134
135 ### Manual Updates 135 ### Manual Updates
136 136
137 If you'd like to upgrade at any point in time (maybe someone just released a new plugin and you don't want to wait a week?)... you just need to run: 137 If you'd like to upgrade at any point in time (maybe someone just released a new plugin and you don't want to wait a week?)... you just need to run:
138 138
139 `upgrade_oh_my_zsh` 139 `upgrade_oh_my_zsh`
140 140
141 Magic! 141 Magic!
142 142
143 ## Uninstalling Oh My Zsh 143 ## Uninstalling Oh My Zsh
144 144
145 Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup. 145 Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup.
146 146
147 If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration. 147 If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration.
148 148
149 ## Contributing 149 ## Contributing
150 150
151 I'm far from being a [Zsh](http://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! 151 I'm far from being a [Zsh](http://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
152 152
153 We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can. 153 We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can.
154 154
155 ### Do NOT Send Us Themes 155 ### Do NOT Send Us Themes
156 156
157 We have (more than) enough themes for the time being. Please fork the project and add one in there – you can let people know how to grab it from there. 157 We have (more than) enough themes for the time being. Please fork the project and add one in there – you can let people know how to grab it from there.
158 158
159 ## Contributors 159 ## Contributors
160 160
161 Oh My Zsh has a vibrant community of happy users and delightful contributors. Without all the time and help from our contributors, it wouldn't be so awesome. 161 Oh My Zsh has a vibrant community of happy users and delightful contributors. Without all the time and help from our contributors, it wouldn't be so awesome.
162 162
163 Thank you so much! 163 Thank you so much!
164 164
165 ## Follow Us 165 ## Follow Us
166 166
167 We have an [ohmyzsh](https://twitter.com/ohmyzsh) account. You should follow it. 167 We have an [ohmyzsh](https://twitter.com/ohmyzsh) account. You should follow it.
168 168
169 ## Merchandise 169 ## Merchandise
170 170
171 We have [stickers](http://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](http://shop.planetargon.com/products/ohmyzsh-t-shirts) for you to show off your love of Oh My Zsh. Again, this will help you become the talk of the town! 171 We have [stickers](http://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](http://shop.planetargon.com/products/ohmyzsh-t-shirts) for you to show off your love of Oh My Zsh. Again, this will help you become the talk of the town!
172 172
173 ## LICENSE 173 ## LICENSE
174 174
175 Oh My Zsh is released under the [MIT license](https://github.com/robbyrussell/oh-my-zsh/blob/master/MIT-LICENSE.txt). 175 Oh My Zsh is released under the [MIT license](https://github.com/robbyrussell/oh-my-zsh/blob/master/MIT-LICENSE.txt).
176 176
1 #compdef adb 1 #compdef adb
2 #autoload 2 #autoload
3 3
4 # in order to make this work, you will need to have the android adb tools 4 # in order to make this work, you will need to have the android adb tools
5 5
6 # adb zsh completion, based on homebrew completion 6 # adb zsh completion, based on homebrew completion
7 7
8 local -a _1st_arguments 8 local -a _1st_arguments
9 _1st_arguments=( 9 _1st_arguments=(
10 'bugreport:return all information from the device that should be included in a bug report.' 10 'bugreport:return all information from the device that should be included in a bug report.'
11 'connect:connect to a device via TCP/IP Port 5555 is default.' 11 'connect:connect to a device via TCP/IP Port 5555 is default.'
12 'devices:list all connected devices' 12 'devices:list all connected devices'
13 'disconnect:disconnect from a TCP/IP device. Port 5555 is default.' 13 'disconnect:disconnect from a TCP/IP device. Port 5555 is default.'
14 'emu:run emulator console command' 14 'emu:run emulator console command'
15 'forward:forward socket connections' 15 'forward:forward socket connections'
16 'help:show the help message' 16 'help:show the help message'
17 'install:push this package file to the device and install it' 17 'install:push this package file to the device and install it'
18 'jdwp:list PIDs of processes hosting a JDWP transport' 18 'jdwp:list PIDs of processes hosting a JDWP transport'
19 'logcat:View device log' 19 'logcat:View device log'
20 'pull:copy file/dir from device' 20 'pull:copy file/dir from device'
21 'push:copy file/dir to device' 21 'push:copy file/dir to device'
22 'shell:run remote shell interactively' 22 'shell:run remote shell interactively'
23 'sync:copy host->device only if changed (-l means list but dont copy)' 23 'sync:copy host->device only if changed (-l means list but dont copy)'
24 ‘tcpip:restart host adb in tcpip mode’
24 'uninstall:remove this app package from the device' 25 'uninstall:remove this app package from the device'
25 'version:show version num' 26 'version:show version num'
26 ) 27 )
27 28
28 local expl 29 local expl
29 local -a pkgs installed_pkgs 30 local -a pkgs installed_pkgs
30 31
31 _arguments \ 32 _arguments \
32 '*:: :->subcmds' && return 0 33 '*:: :->subcmds' && return 0
33 34
34 if (( CURRENT == 1 )); then 35 if (( CURRENT == 1 )); then
35 _describe -t commands "adb subcommand" _1st_arguments 36 _describe -t commands "adb subcommand" _1st_arguments
36 return 37 return
37 fi 38 fi
38 39
39 _files 40 _files
40 41
plugins/django/django.plugin.zsh
1 #compdef manage.py 1 #compdef manage.py
2 2
3 typeset -ga nul_args 3 typeset -ga nul_args
4 nul_args=( 4 nul_args=(
5 '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))'
5 '--settings=-[the Python path to a settings module.]:file:_files' 6 '--settings=-[the Python path to a settings module.]:file:_files'
6 '--pythonpath=-[a directory to add to the Python path.]::directory:_directories' 7 '--pythonpath=-[a directory to add to the Python path.]:directory:_directories'
7 '--traceback[print traceback on exception.]' 8 '--traceback[print traceback on exception.]'
9 "--no-color[Don't colorize the command output.]"
8 "--version[show program's version number and exit.]" 10 "--version[show program's version number and exit.]"
9 {-h,--help}'[show this help message and exit.]' 11 {-h,--help}'[show this help message and exit.]'
10 ) 12 )
11 13
12 _managepy-adminindex(){ 14 typeset -ga start_args
15 start_args=(
16 '--template=-[The path or URL to load the template from.]:directory:_directories'
17 '--extension=-[The file extension(s) to render (default: "py").]'
18 '--name=-[The file name(s) to render.]:file:_files'
19 )
20
21 typeset -ga db_args
22 db_args=(
23 '--database=-[Nominates a database. Defaults to the "default" database.]'
24 )
25
26 typeset -ga noinput_args
27 noinput_args=(
28 '--noinput[tells Django to NOT prompt the user for input of any kind.]'
29 )
30
31 typeset -ga no_init_data_args
32 no_init_data_args=(
33 '--no-initial-data[Tells Django not to load any initial data after database synchronization.]'
34 )
35
36 typeset -ga tag_args
37 tag_args=(
38 '--tag=-[Run only checks labeled with given tag.]'
39 '--list-tags[List available tags.]'
40 )
41
42 _managepy-check(){
13 _arguments -s : \ 43 _arguments -s : \
14 $nul_args \ 44 $tag_args \
15 '*::directory:_directories' && ret=0 45 $nul_args && ret=0
46 }
47
48 _managepy-changepassword(){
49 _arguments -s : \
50 $db_args \
51 $nul_args && ret=0
16 } 52 }
17 53
18 _managepy-createcachetable(){ 54 _managepy-createcachetable(){
19 _arguments -s : \ 55 _arguments -s : \
56 $db_args \
57 $nul_args && ret=0
58 }
59
60 _managepy-createsuperuser(){
61 _arguments -s : \
62 '--username=-[Specifies the login for the superuser.]' \
63 '--email=-[Specifies the email for the superuser.]' \
64 $noinput_args \
65 $db_args \
20 $nul_args && ret=0 66 $nul_args && ret=0
21 } 67 }
22 68
23 _managepy-collectstatic(){ 69 _managepy-collectstatic(){
24 _arguments -s : \ 70 _arguments -s : \
25 '--link=-[Create a symbolic link to each file instead of copying.]:' \ 71 '--link[Create a symbolic link to each file instead of copying.]' \
26 '--noinput=-[Do NOT prompt the user for input of any kind.]:' \ 72 '--no-post-process[Do NOT post process collected files.]' \
27 '--no-post-process=-[Do NOT post process collected files.]:' \ 73 '--ignore=-[Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more.]' \
28 '--ignore=-[Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more.]:' \ 74 '--dry-run[Do everything except modify the filesystem.]' \
29 '--dry-run=-[Do everything except modify the filesystem.]:' \ 75 '--clear[Clear the existing files using the storage before trying to copy or link the original file.]' \
30 '--clear=-[Clear the existing files using the storage before trying to copy or link the original file.]:' \ 76 '--link[Create a symbolic link to each file instead of copying.]' \
31 '--link=-[Create a symbolic link to each file instead of copying.]:' \ 77 '--no-default-ignore[Do not ignore the common private glob-style patterns "CVS", ".*" and "*~".]' \
32 '--no-default-ignore=-[Do not ignore the common private glob-style patterns "CVS", ".*" and "*~".]:' \ 78 $noinput_args \
33 $nul_args && ret=0 79 $nul_args && ret=0
34 } 80 }
35 81
36 _managepy-dbshell(){ 82 _managepy-dbshell(){
37 _arguments -s : \ 83 _arguments -s : \
84 $db_args \
38 $nul_args && ret=0 85 $nul_args && ret=0
39 } 86 }
40 87
41 _managepy-diffsettings(){ 88 _managepy-diffsettings(){
42 _arguments -s : \ 89 _arguments -s : \
90 "--all[Display all settings, regardless of their value.]"
43 $nul_args && ret=0 91 $nul_args && ret=0
44 } 92 }
45 93
46 _managepy-dumpdata(){ 94 _managepy-dumpdata(){
47 _arguments -s : \ 95 _arguments -s : \
48 '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \ 96 '--format=-[Specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
49 '--indent=-[specifies the indent level to use when pretty-printing output.]:' \ 97 '--indent=-[Specifies the indent level to use when pretty-printing output.]' \
98 '--exclude=-[An app_label or app_label.ModelName to exclude (use multiple --exclude to exclude multiple apps/models).]' \
99 '--natural-foreign[Use natural foreign keys if they are available.]' \
100 '--natural-primary[Use natural primary keys if they are available.]' \
101 "--all[Use Django's base manager to dump all models stored in the database.]" \
102 '--pks=-[Only dump objects with given primary keys.]' \
103 $db_args \
50 $nul_args \ 104 $nul_args \
51 '*::appname:_applist' && ret=0 105 '*::appname:_applist' && ret=0
52 } 106 }
53 107
54 _managepy-flush(){ 108 _managepy-flush(){
55 _arguments -s : \ 109 _arguments -s : \
56 '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ 110 $no_init_data_args \
57 '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ 111 $db_args \
112 $noinput_args \
58 $nul_args && ret=0 113 $nul_args && ret=0
59 } 114 }
60 115
61 _managepy-help(){ 116 _managepy-help(){
62 _arguments -s : \ 117 _arguments -s : \
63 '*:command:_managepy_cmds' \ 118 '*:command:_managepy_cmds' \
64 $nul_args && ret=0 119 $nul_args && ret=0
65 } 120 }
66 121
67 _managepy_cmds(){ 122 _managepy_cmds(){
68 local line 123 local line
69 local -a cmd 124 local -a cmd
70 _call_program help-command ./manage.py help \ 125 _call_program help-command ./manage.py help \
71 |& sed -n '/^ /s/[(), ]/ /gp' \ 126 |& sed -n '/^ /s/[(), ]/ /gp' \
72 | while read -A line; do cmd=($line $cmd) done 127 | while read -A line; do cmd=($line $cmd) done
73 _describe -t managepy-command 'manage.py command' cmd 128 _describe -t managepy-command 'manage.py command' cmd
74 } 129 }
75 130
76 _managepy-inspectdb(){ 131 _managepy-inspectdb(){
77 _arguments -s : \ 132 _arguments -s : \
133 $db_args \
78 $nul_args && ret=0 134 $nul_args && ret=0
79 } 135 }
80 136
81 _managepy-loaddata(){ 137 _managepy-loaddata(){
82 _arguments -s : \ 138 _arguments -s : \
83 '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ 139 '--ignorenonexistent[Ignores entries in the serialized data for fields that do not currently exist on the model.]' \
140 '--app=-[Only look for fixtures in the specified app.]:appname:_applist' \
84 '*::file:_files' \ 141 '*::file:_files' \
142 $db_args \
85 $nul_args && ret=0 143 $nul_args && ret=0
86 } 144 }
87 145
88 _managepy-reset(){ 146 _managepy-makemessages(){
89 _arguments -s : \ 147 _arguments -s : \
90 '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ 148 '--locale=-[Creates or updates the message files for the given locale(s) (e.g. pt_BR).]' \
91 '*::appname:_applist' \ 149 '--domain=-[The domain of the message files (default: "django").]' \
150 '--all[Updates the message files for all existing locales.]' \
151 '--extension=-[The file extension(s) to examine (default: "html,txt", or "js" if the domain is "djangojs").]' \
152 '--symlinks[Follows symlinks to directories when examining source code and templates for translation strings.]' \
153 '--ignore=-[Ignore files or directories matching this glob-style pattern.]' \
154 "--no-default-ignore[Don't ignore the common glob-style patterns 'CVS', '.*', '*~' and '*.pyc'.]" \
155 "--no-wrap[Don't break long message lines into several lines.]" \
156 "--no-location[Don't write '#: filename:line' lines.]" \
157 '--no-obsolete[emove obsolete message strings.]' \
158 '--keep-pot[Keep .pot file after making messages.]' \
159 $nul_args && ret=0
160 }
161 _managepy-makemigrations(){
162 _arguments -s : \
163 '--dry-run[Just show what migrations would be made]' \
164 '--merge[Enable fixing of migration conflicts.]' \
165 '--empty[Create an empty migration.]' \
166 $noinput_args \
167 $nul_args && ret=0
168 }
169 _managepy-migrate(){
170 _arguments -s : \
171 '--fake[Mark migrations as run without actually running them]' \
172 '--list[Show a list of all known migrations and which are applied]' \
173 $no_init_data_args \
174 $noinput_args \
175 $db_args \
92 $nul_args && ret=0 176 $nul_args && ret=0
93 } 177 }
94 178
95 _managepy-runfcgi(){ 179 _managepy-runfcgi(){
96 local state 180 local state
97 181
98 local fcgi_opts 182 local fcgi_opts
99 fcgi_opts=( 183 fcgi_opts=(
100 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)' 184 'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
101 'host[hostname to listen on..]:' 185 'host[hostname to listen on..]:'
102 'port[port to listen on.]:' 186 'port[port to listen on.]:'
103 'socket[UNIX socket to listen on.]::file:_files' 187 'socket[UNIX socket to listen on.]:file:_files'
104 'method[prefork or threaded (default prefork)]:method:(prefork threaded)' 188 'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
105 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:' 189 'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
106 'maxspare[max number of spare processes / threads.]:' 190 'maxspare[max number of spare processes / threads.]:'
107 'minspare[min number of spare processes / threads.]:' 191 'minspare[min number of spare processes / threads.]:'
108 'maxchildren[hard limit number of processes / threads.]:' 192 'maxchildren[hard limit number of processes / threads.]:'
109 'daemonize[whether to detach from terminal.]:boolean:(False True)' 193 'daemonize[whether to detach from terminal.]:boolean:(False True)'
110 'pidfile[write the spawned process-id to this file.]:file:_files' 194 'pidfile[write the spawned process-id to this file.]:file:_files'
111 'workdir[change to this directory when daemonizing.]:directory:_files' 195 'workdir[change to this directory when daemonizing.]:directory:_files'
112 'outlog[write stdout to this file.]:file:_files' 196 'outlog[write stdout to this file.]:file:_files'
113 'errlog[write stderr to this file.]:file:_files' 197 'errlog[write stderr to this file.]:file:_files'
114 ) 198 )
115 199
116 _arguments -s : \ 200 _arguments -s : \
117 $nul_args \ 201 $nul_args \
118 '*: :_values "FCGI Setting" $fcgi_opts' && ret=0 202 '*: :_values "FCGI Setting" $fcgi_opts' && ret=0
119 } 203 }
120 204
121 _managepy-runserver(){ 205 _managepy-runserver(){
122 _arguments -s : \ 206 _arguments -s : \
123 '--noreload[tells Django to NOT use the auto-reloader.]' \ 207 '--ipv6[Tells Django to use an IPv6 address.]' \
124 '--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \ 208 '--nothreading[Tells Django to NOT use threading.]' \
209 '--noreload[Tells Django to NOT use the auto-reloader.]' \
210 '--nostatic[Tells Django to NOT automatically serve static files at STATIC_URL.]' \
211 '--insecure[Allows serving static files even if DEBUG is False.]' \
125 $nul_args && ret=0 212 $nul_args && ret=0
126 } 213 }
127 214
128 _managepy-shell(){ 215 _managepy-shell(){
129 _arguments -s : \ 216 _arguments -s : \
130 '--plain[tells Django to use plain Python, not IPython.]' \ 217 '--plain[Tells Django to use plain Python, not IPython.]' \
218 '--no-startup[When using plain Python, ignore the PYTHONSTARTUP environment variable and ~/.pythonrc.py script.]' \
219 '--interface=-[Specify an interactive interpreter interface.]:INTERFACE:((ipython bpython))' \
220 $nul_args && ret=0
221 }
222
223 _managepy-sql(){
224 _arguments -s : \
225 $db_args \
226 $nul_args && ret=0
227 }
228
229 _managepy-sqlall(){
230 _arguments -s : \
231 $db_args \
232 $nul_args && ret=0
233 }
234
235 _managepy-sqlclear(){
236 _arguments -s : \
237 $db_args \
238 $nul_args && ret=0
239 }
240
241 _managepy-sqlcustom(){
242 _arguments -s : \
243 $db_args \
244 $nul_args && ret=0
245 }
246
247 _managepy-dropindexes(){
248 _arguments -s : \
249 $db_args \
131 $nul_args && ret=0 250 $nul_args && ret=0
132 } 251 }
133 252
134 _managepy-sql(){} 253 _managepy-sqlflush(){
135 _managepy-sqlall(){} 254 _arguments -s : \
136 _managepy-sqlclear(){} 255 $db_args \
137 _managepy-sqlcustom(){} 256 $nul_args && ret=0
138 _managepy-sqlflush(){} 257 }
139 _managepy-sqlindexes(){} 258
140 _managepy-sqlinitialdata(){} 259 _managepy-sqlindexes(){
141 _managepy-sqlreset(){} 260 _arguments -s : \
142 _managepy-sqlsequencereset(){} 261 $db_args \
143 _managepy-startapp(){} 262 $nul_args && ret=0
144 _managepy-startproject(){} 263 }
264
265 _managepy-sqlinitialdata(){
266 _arguments -s : \
267 $nul_args && ret=0
268 }
269
270 _managepy-sqlsequencereset(){
271 _arguments -s : \
272 $db_args \
273 $nul_args && ret=0
274 }
275
276 _managepy-squashmigrations(){
277 _arguments -s : \
278 '--no-optimize[Do not try to optimize the squashed operations.]' \
279 $noinput_args \
280 $nul_args && ret=0
281 }
282
283 _managepy-startapp(){
284 _arguments -s : \
285 $start_args \
286 $nul_args && ret=0
287 }
288 _managepy-startproject(){
289 _arguments -s : \
290 $start_args \
291 $nul_args && ret=0
292 }
145 293
146 _managepy-syncdb() { 294 _managepy-syncdb() {
147 _arguments -s : \ 295 _arguments -s : \
148 '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ 296 $noinput_args \
149 '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ 297 $no_init_data_args \
298 $db_args \
150 $nul_args && ret=0 299 $nul_args && ret=0
151 } 300 }
152 301
153 _managepy-test() { 302 _managepy-test() {
154 _arguments -s : \ 303 _arguments -s : \
155 '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \ 304 '--failfast[Tells Django to stop running the test suite after first failed test.]' \
156 '--noinput[tells Django to NOT prompt the user for input of any kind.]' \ 305 '--testrunner=-[Tells Django to use specified test runner class instead of the one specified by the TEST_RUNNER setting.]' \
306 '--liveserver=-[Overrides the default address where the live server (used with LiveServerTestCase) is expected to run from. The default value is localhost:8081.]' \
307 '--top-level-directory=-[Top level of project for unittest discovery.]' \
308 '--pattern=-[The test matching pattern. Defaults to test*.py.]:' \
309 $noinput_args \
157 '*::appname:_applist' \ 310 '*::appname:_applist' \
158 $nul_args && ret=0 311 $nul_args && ret=0
159 } 312 }
160 313
161 _managepy-testserver() { 314 _managepy-testserver() {
162 _arguments -s : \ 315 _arguments -s : \
163 '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
164 '--addrport=-[port number or ipaddr:port to run the server on.]' \ 316 '--addrport=-[port number or ipaddr:port to run the server on.]' \
317 '--ipv6[Tells Django to use an IPv6 address.]' \
318 $noinput_args \
165 '*::fixture:_files' \ 319 '*::fixture:_files' \
166 $nul_args && ret=0 320 $nul_args && ret=0
167 } 321 }
168 322
169 _managepy-validate() { 323 _managepy-validate() {
170 _arguments -s : \ 324 _arguments -s : \
325 $tag_args \
171 $nul_args && ret=0 326 $nul_args && ret=0
172 } 327 }
173 328
174 _managepy-commands() { 329 _managepy-commands() {
175 local -a commands 330 local -a commands
176 331
177 commands=( 332 commands=(
178 'adminindex:prints the admin-index template snippet for the given app name(s).' 333 "changepassword:Change a user's password for django.contrib.auth."
179 'createcachetable:creates the table needed to use the SQL cache backend.' 334 'check:Checks the entire Django project for potential problems.'
335 'compilemessages:Compiles .po files to .mo files for use with builtin gettext support.'
336 'createcachetable:Creates the table needed to use the SQL cache backend.'
337 'createsuperuser:Used to create a superuser.'
180 'collectstatic:Collect static files in a single location.' 338 'collectstatic:Collect static files in a single location.'
181 'dbshell:runs the command-line client for the current DATABASE_ENGINE.' 339 'dbshell:Runs the command-line client for the current DATABASE_ENGINE.'
182 "diffsettings:displays differences between the current settings.py and Django's default settings." 340 "diffsettings:Displays differences between the current settings.py and Django's default settings."
183 'dumpdata:Output the contents of the database as a fixture of the given format.' 341 'dumpdata:Output the contents of the database as a fixture of the given format.'
184 'flush:Executes ``sqlflush`` on the current database.' 342 'flush:Executes ``sqlflush`` on the current database.'
185 'help:manage.py help.' 343 'help:manage.py help.'
186 'inspectdb:Introspects the database tables in the given database and outputs a Django model module.' 344 'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
187 'loaddata:Installs the named fixture(s) in the database.' 345 'loaddata:Installs the named fixture(s) in the database.'
188 'reset:Executes ``sqlreset`` for the given app(s) in the current database.' 346 'makemessages:Runs over the entire source tree of the current directory and pulls out all strings marked for translation.'
347 'makemigrations:Creates new migration(s) for apps.'
348 'migrate:Updates database schema. Manages both apps with migrations and those without.'
189 'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,' 349 'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
190 'runserver:Starts a lightweight Web server for development.' 350 'runserver:Starts a lightweight Web server for development.'
191 'shell:Runs a Python interactive interpreter.' 351 'shell:Runs a Python interactive interpreter.'
192 'sql:Prints the CREATE TABLE SQL statements for the given app name(s).' 352 'sql:Prints the CREATE TABLE SQL statements for the given app name(s).'
193 'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).' 353 'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
194 'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).' 354 'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
195 'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).' 355 'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).'
356 'sqldropindexes:Prints the DROP INDEX SQL statements for the given model module name(s).'
196 'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.' 357 'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.'
197 'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).' 358 'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
198 "sqlinitialdata:RENAMED: see 'sqlcustom'" 359 "sqlinitialdata:RENAMED: see 'sqlcustom'"
199 'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
200 'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).' 360 'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
361 'squashmigrations:Squashes an existing set of migrations (from first until specified) into a single new one.'
201 "startapp:Creates a Django app directory structure for the given app name in this project's directory." 362 "startapp:Creates a Django app directory structure for the given app name in this project's directory."
202 "startproject:Creates a Django project directory structure for the given project name in this current directory." 363 "startproject:Creates a Django project directory structure for the given project name in this current directory."
203 "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created." 364 "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
204 'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.' 365 'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
205 'testserver:Runs a development server with data from the given fixture(s).' 366 'testserver:Runs a development server with data from the given fixture(s).'
206 'validate:Validates all installed models.' 367 'validate:Validates all installed models.'
207 ) 368 )
208 369
209 _describe -t commands 'manage.py command' commands && ret=0 370 _describe -t commands 'manage.py command' commands && ret=0
210 } 371 }
211 372
212 _applist() { 373 _applist() {
213 local line 374 local line
214 local -a apps 375 local -a apps
215 _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\ 376 _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\
216 bn=op.basename(op.abspath(op.curdir));[sys\\ 377 bn=op.basename(op.abspath(op.curdir));[sys\\
217 .stdout.write(str(re.sub(r'^%s\.(.*?)$' % 378 .stdout.write(str(re.sub(r'^%s\.(.*?)$' %
218 bn, r'\1', i)) + '\n') for i in django.conf.settings.\\ 379 bn, r'\1', i)) + '\n') for i in django.conf.settings.\\
219 INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \ 380 INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \
220 | while read -A line; do apps=($line $apps) done 381 | while read -A line; do apps=($line $apps) done
221 _values 'Application' $apps && ret=0 382 _values 'Application' $apps && ret=0
222 } 383 }
223 384
224 _managepy() { 385 _managepy() {
225 local curcontext=$curcontext ret=1 386 local curcontext=$curcontext ret=1
226 387
227 if ((CURRENT == 2)); then 388 if ((CURRENT == 2)); then
228 _managepy-commands 389 _managepy-commands
229 else 390 else
230 shift words 391 shift words
231 (( CURRENT -- )) 392 (( CURRENT -- ))
232 curcontext="${curcontext%:*:*}:managepy-$words[1]:" 393 curcontext="${curcontext%:*:*}:managepy-$words[1]:"
233 _call_function ret _managepy-$words[1] 394 _call_function ret _managepy-$words[1]
234 fi 395 fi
235 } 396 }
236 397
237 compdef _managepy manage.py 398 compdef _managepy manage.py
238 compdef _managepy django 399 compdef _managepy django
239 compdef _managepy django-admin 400 compdef _managepy django-admin
240 compdef _managepy django-admin.py 401 compdef _managepy django-admin.py
plugins/npm/npm.plugin.zsh
1 eval "$(npm completion 2>/dev/null)" 1 eval "$(npm completion 2>/dev/null)"
2 2
3 # Install and save to dependencies
4 alias npms="npm i -S "
5 3
6 # Install and save to dev-dependencies 4 # npm package names are lowercase
7 alias npmd="npm i -D " 5 # - https://twitter.com/substack/status/23122603153150361
6 # Thus, we've used camelCase for the following aliases:
7
8 # Install and save to dependencies in your package.json
9 # npms is used by https://www.npmjs.com/package/npms
10 alias npmS="npm i -S "
11
12 # Install and save to dev-dependencies in your package.json
13 # npmd is used by https://github.com/dominictarr/npmd