Browse Source

Add docstrings

Alois Mahdal 9 years ago
parent
commit
28501a0bd6
1 changed files with 18 additions and 0 deletions
  1. 18
    0
      libexec/saturnin-clip

+ 18
- 0
libexec/saturnin-clip View File

@@ -5,6 +5,9 @@
5 5
 ffoo import config
6 6
 ffoo import pretty
7 7
 
8
+#
9
+# Where to store clips
10
+#
8 11
 STORAGE_DIR="$SATURNIN_CACHE_HOME/clips"
9 12
 
10 13
 usage() {
@@ -33,6 +36,9 @@ clipln() {
33 36
 }
34 37
 
35 38
 save_clip() {
39
+    #
40
+    # Save single clip
41
+    #
36 42
     local clipname=$1
37 43
     mkdir -p "$STORAGE_DIR" || die "could not create directory for saving"
38 44
     local path="$STORAGE_DIR/$(date +%Y%m%d-%H%M%S.clip)"
@@ -40,6 +46,9 @@ save_clip() {
40 46
 }
41 47
 
42 48
 lsclips() {
49
+    #
50
+    # List clips with MIME types and hints
51
+    #
43 52
     local clipname=$1
44 53
     local ft hint name
45 54
     test -d "$STORAGE_DIR" || return 0
@@ -60,18 +69,27 @@ lsclips() {
60 69
 }
61 70
 
62 71
 load_clip() {
72
+    #
73
+    # Load single clip of choice
74
+    #
63 75
     local clipname=$1
64 76
     local name=$(saturnin clip ls | saturnin dmenu | cut -d\   -f 1)
65 77
     cat $STORAGE_DIR/$name | xclip -i -selection $clipname
66 78
 }
67 79
 
68 80
 rm_clip() {
81
+    #
82
+    # Remove single clip of choice
83
+    #
69 84
     local clipname=$1
70 85
     local name=$(saturnin clip ls | saturnin dmenu | cut -d\   -f 1)
71 86
     rm -f $STORAGE_DIR/$name
72 87
 }
73 88
 
74 89
 rm_all() {
90
+    #
91
+    # Dump all clips
92
+    #
75 93
     test -n "$STORAGE_DIR" || die "storage directory is unset, aborting"
76 94
     test -d "$STORAGE_DIR" || return 0
77 95
     find "$STORAGE_DIR" -name "*.clip" | xargs rm -f