Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Added autocompletion for Bash #17

Merged
merged 1 commit into from over 1 year ago

2 participants

Jordi Funollet Oscar Del Ben
Jordi Funollet

A minimal configuration so Bash can autocomplete both sheet commands and existing cheats. Change the directories if you have in mind another layout.

Jordi Funollet

I harcoded the names of commands. I couldn't find a way of retrieve them dynamically, but I'm open to any suggestions.

Oscar Del Ben
Owner

awesome thanks

Oscar Del Ben oscardelben merged commit 43e4e80 into from November 07, 2012
Oscar Del Ben oscardelben closed this November 07, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Nov 07, 2012
Jordi Funollet Added autocompletion for Bash. 8f68589
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 24 additions and 0 deletions. Show diff stats Hide diff stats

  1. 24  contrib/completion/sheet.bash
24  contrib/completion/sheet.bash
... ...
@@ -0,0 +1,24 @@
  1
+# Bash completion for 'sheet' (http://oscardelben.com/sheet/).
  2
+
  3
+function _sheet_complete() {
  4
+    _get_comp_words_by_ref cur prev
  5
+    COMPREPLY=()
  6
+
  7
+    case "${prev}" in
  8
+        list|new)
  9
+            return 0
  10
+            ;;
  11
+        edit|copy)
  12
+            COMPREPLY=( $(compgen -W "$(sheet list)" -- "${cur}") )
  13
+            return 0
  14
+            ;;
  15
+        *)
  16
+            ;;
  17
+    esac
  18
+
  19
+    COMPREPLY=( $(compgen -W "list new edit copy $(sheet list)" -- ${cur}) )
  20
+
  21
+}
  22
+
  23
+complete -o nospace -F _sheet_complete sheet
  24
+
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.