File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class BitBarLine {
2424 protected $ length ;
2525 protected $ terminal ;
2626 protected $ bash ;
27+ protected $ params = [];
2728 protected $ dropdown ;
2829 protected $ image ;
2930 protected $ imageIsTemplate = false ;
@@ -120,13 +121,17 @@ public function setTerminal($boolean) {
120121 $ this ->terminal = (boolean ) $ boolean ;
121122 return $ this ;
122123 }
123-
124+
124125 /**
125- * @param mixed text
126+ * @param string text
127+ * @param array $params
128+ *
126129 * @return $this
127130 */
128- public function setBash ($ text ) {
129- $ this ->bash = $ text ;
131+ public function setBash ( $ text , array $ params = [] )
132+ {
133+ $ this ->bash = $ text ;
134+ $ this ->params = $ params ;
130135 return $ this ;
131136 }
132137
@@ -280,7 +285,10 @@ public function format() {
280285 $ this ->usedPipe = true ;
281286 }
282287
283- $ string .= ' bash= ' . $ this ->bash ;
288+ $ string .= sprintf (' bash="%s" ' , $ this ->bash );
289+
290+ foreach (array_values ($ this ->params ) as $ k => $ param )
291+ $ string .= sprintf (' param%s="%s" ' , ++$ k , $ param );
284292 }
285293
286294 if ($ this ->refresh ) {
You can’t perform that action at this time.
0 commit comments