Skip to content

Commit

Permalink
feat: restarting and stopping now propose currently running services
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieusb committed Mar 14, 2020
1 parent f1213ee commit 4b8b0a4
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 3 deletions.
197 changes: 197 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@

# Created by https://www.gitignore.io/api/jetbrains+all,jetbrains+iml,jetbrains
# Edit at https://www.gitignore.io/?templates=jetbrains+all,jetbrains+iml,jetbrains

### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/**/sonarlint/

# SonarQube Plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator/

### JetBrains+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff

# Generated files

# Sensitive or high-churn files

# Gradle

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake

# Mongo Explorer plugin

# File-based project format

# IntelliJ

# mpeltonen/sbt-idea plugin

# JIRA plugin

# Cursive Clojure plugin

# Crashlytics plugin (for Android Studio and IntelliJ)

# Editor-based Rest Client

# Android studio 3.1+ serialized cache file

### JetBrains+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint

### JetBrains+iml ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff

# Generated files

# Sensitive or high-churn files

# Gradle

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake

# Mongo Explorer plugin

# File-based project format

# IntelliJ

# mpeltonen/sbt-idea plugin

# JIRA plugin

# Cursive Clojure plugin

# Crashlytics plugin (for Android Studio and IntelliJ)

# Editor-based Rest Client

# Android studio 3.1+ serialized cache file

### JetBrains+iml Patch ###
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023


# End of https://www.gitignore.io/api/jetbrains+all,jetbrains+iml,jetbrains
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ plugins=(... zsh-edward)

## Usage

This plugin solely contains completion scripts and aliases
This plugin solely contains completion scripts and aliases.
It will allow you to have completion when starting/restarting/stopping services or groups.

### Usage help

Expand Down Expand Up @@ -70,7 +71,7 @@ Flags:
Use "edward [command] --help" for more information about a command.
```

Some aliases are available through this plugin:
Some aliases are available through this plugin, completion still works when using them:

| Alias | Command |
| ------------- |-------------|
Expand Down
20 changes: 19 additions & 1 deletion _zsh-edward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ zstyle ':completion:*:descriptions' format '%B%d%b'

zstyle ':completion::complete:edward:*:commands' group-name commands
zstyle ':completion::complete:edward:*:arguments' group-name arguments
zstyle ':completion::complete:edward:*:running' group-name running
zstyle ':completion::complete:edward:*:groups' group-name groups
zstyle ':completion::complete:edward:*:services' group-name services

Expand Down Expand Up @@ -40,6 +41,15 @@ __describe_commands_arguments() {
##### SECOND ARG FUNCTIONS
########################################################

__get_current_edward_running() {
local -a running

running=( $(edward status | grep "RUNNING" | cut -d '|' -f 3 | sed -e "s/[[:space:]]//;/^$/g"))
_describe -t running "Currently running" running && ret=0

unset running
}

__get_current_edward_groups() {
local -a groups

Expand Down Expand Up @@ -80,10 +90,18 @@ function _edward() {
;;
second_arg)
case $target in
start|restart|stop)
stop)
__get_current_edward_running
__get_current_edward_groups
__get_current_edward_services
;;
start)
__get_current_edward_groups
__get_current_edward_services
;;
restart)
__get_current_edward_running
;;
tail|tiplog)
__get_current_edward_services
;;
Expand Down

0 comments on commit 4b8b0a4

Please sign in to comment.