From 2dcbdaf12c2f674d2b8f5c0a464437c32179902f Mon Sep 17 00:00:00 2001 From: The Codacy Badger Date: Tue, 6 Nov 2018 22:36:31 +0000 Subject: [PATCH 1/7] Add Codacy badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6c173a6..e4ad403 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # VIM Header Composer +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/25db628e07014abc9b4bb7e7750c916c)](https://app.codacy.com/app/jmurowaniecki/vim-header-composer?utm_source=github.com&utm_medium=referral&utm_content=jmurowaniecki/vim-header-composer&utm_campaign=Badge_Grade_Settings) + VIM header composer is an utility script wrote in shell very simple to make header's based on comments in vim such as above. The string will be formated and fulfilled with characters following your desired style. From bbc736806d96394b9e8242723bd074d9ecc72ecb Mon Sep 17 00:00:00 2001 From: John Murowaniecki Date: Wed, 7 Nov 2018 21:49:50 -0200 Subject: [PATCH 2/7] styleci and codacy issues --- README.md | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 6c173a6..4850b64 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # VIM Header Composer +[![StyleCI](https://github.styleci.io/repos/103320898/shield?branch=master)](https://github.styleci.io/repos/103320898) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/9ac72e1294504b06b245a7b4d8253029)](https://www.codacy.com/app/jmurowaniecki/vim-header-composer?utm_source=github.com&utm_medium=referral&utm_content=jmurowaniecki/vim-header-composer&utm_campaign=Badge_Grade) + VIM header composer is an utility script wrote in shell very simple to make header's based on comments in vim such as above. The string will be formated and fulfilled with characters following your desired style. -```sh +```text ############################################ #### CREATE FILE BAR AND SEND TO SERVER #### ############################################ @@ -13,7 +15,7 @@ $ RUN echo "foo" > bar $ RUN scp -i bar example.com:/dev/null ``` -# Installation +## Installation ```sh $ git clone https://github.com/ernandos/vim-header-composer.git @@ -22,7 +24,7 @@ $ sudo ln -s /opt/vim-header-composer/vhc /usr/local/bin $ echo 'map :!vhc' >> ~/.vimrc ``` -# Basic usage +## Basic usage ``` 1 - Open any file @@ -30,7 +32,7 @@ $ echo 'map :!vhc' >> ~/.vimrc 3 - Press and ``` -## Using styles +### Using styles Instead of using the characters and the standard format you can set the string to process using styles as seen below. ``` @@ -43,64 +45,64 @@ $ echo "vhc:prettybox;Woooow I'm using prettybox!"|vhc $ ``` -### `sides` -`$ echo "vhc:sides;Woooow I'm using sides!"|vhc` produces: +#### `sides` +`echo "vhc:sides;Woooow I'm using sides!"|vhc` produces: ``` ⎡ ⎤ ⎢ Woooow I'm using sides! ⎥ ⎣ ⎦ ``` -### `prettybox` -`$ echo "vhc:prettybox;Woooow I'm using prettybox!"|vhc` produces: +#### `prettybox` +`echo "vhc:prettybox;Woooow I'm using prettybox!"|vhc` produces: ``` ┌─────────────────────────────┐ │ Woooow I'm using prettybox! │ └─────────────────────────────┘ ``` -### `quotes` -`$ echo "vhc:quotes;Woooow I'm using quotes!"|vhc` produces: +#### `quotes` +`echo "vhc:quotes;Woooow I'm using quotes!"|vhc` produces: ``` " Woooow I'm using quotes! -" +" ``` -### `ccomment` -`$ echo "vhc:ccomment;Woooow I'm using ccomment!"|vhc` produces: +#### `ccomment` +`echo "vhc:ccomment;Woooow I'm using ccomment!"|vhc` produces: ``` -/* +/* * Woooow I'm using ccomment! -*/ +*/ ``` -### `lcomment` -`$ echo "vhc:lcomment;Woooow I'm using lcomment!"|vhc` produces: +#### `lcomment` +`echo "vhc:lcomment;Woooow I'm using lcomment!"|vhc` produces: ``` -// +// // Woooow I'm using lcomment! -// +// ``` -### `box` -`$ echo "vhc:box;Woooow I'm using box!"|vhc` produces: +#### `box` +`echo "vhc:box;Woooow I'm using box!"|vhc` produces: ``` +-----------------------+ | Woooow I'm using box! | +-----------------------+ ``` -### `star`, `stars` or `asterisk` -`$ echo "vhc:stars;Woooow I'm using stars!"|vhc` produces: +#### `star`, `stars` or `asterisk` +`echo "vhc:stars;Woooow I'm using stars!"|vhc` produces: ``` *************************** * Woooow I'm using stars! * *************************** ``` -### Standart `ernjs` or `ernando` -`$ echo "vhc:awesome;Woooow I'm using VHC!"|vhc` produces: +#### Standart `ernjs` or `ernando` +`echo "vhc:awesome;Woooow I'm using VHC!"|vhc` produces: ``` ############################### #### Woooow I'm using VHC! #### From d0bcc921a00ffb7e2d818505c80b67e269d0b8d5 Mon Sep 17 00:00:00 2001 From: John Murowaniecki Date: Wed, 7 Nov 2018 21:59:30 -0200 Subject: [PATCH 3/7] fix markdown readme --- README.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d8268ba..d76f1c4 100644 --- a/README.md +++ b/README.md @@ -12,26 +12,25 @@ The string will be formated and fulfilled with characters following your desired #### CREATE FILE BAR AND SEND TO SERVER #### ############################################ -$ RUN echo "foo" > bar -$ RUN scp -i bar example.com:/dev/null +RUN echo "foo" > bar +RUN scp -i bar example.com:/dev/null ``` ## Installation ```sh -$ git clone https://github.com/ernandos/vim-header-composer.git -$ sudo mv vim-header-composer /opt/ -$ sudo ln -s /opt/vim-header-composer/vhc /usr/local/bin -$ echo 'map :!vhc' >> ~/.vimrc +git clone https://github.com/ernandos/vim-header-composer.git +sudo mv vim-header-composer /opt/ +sudo ln -s /opt/vim-header-composer/vhc /usr/local/bin +echo 'map :!vhc' >> ~/.vimrc ``` -## Basic usage +## Basic usage steps -``` -1 - Open any file -2 - In normal VIM mode (press ), select the line with SHIT + V -3 - Press and -``` +0. Install this script globally; +1. Open any file using VI/VIM; +2. In normal VIM mode (press ), select the line with SHIT + V; +3. Press and ; ### Using styles Instead of using the characters and the standard format you can set the string to process using styles as seen below. From 62225ae3ae26f2bc8a538dd7a2bc6ee9f99df933 Mon Sep 17 00:00:00 2001 From: John Murowaniecki Date: Wed, 7 Nov 2018 22:04:03 -0200 Subject: [PATCH 4/7] :trollface: --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d76f1c4..971e8c3 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,10 @@ echo 'map :!vhc' >> ~/.vimrc ## Basic usage steps -0. Install this script globally; -1. Open any file using VI/VIM; -2. In normal VIM mode (press ), select the line with SHIT + V; -3. Press and ; +1. Install this script globally; +2. Open any file using VI/VIM; +3. In normal VIM mode (press ), select the line with SHIT + V; +4. Press and ; ### Using styles Instead of using the characters and the standard format you can set the string to process using styles as seen below. From 870e8ffa820948a93d8b9c48a5b5ab498e12f68c Mon Sep 17 00:00:00 2001 From: John Murowaniecki Date: Wed, 7 Nov 2018 22:09:32 -0200 Subject: [PATCH 5/7] :facepalm: --- README.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 971e8c3..07047cd 100644 --- a/README.md +++ b/README.md @@ -35,19 +35,16 @@ echo 'map :!vhc' >> ~/.vimrc ### Using styles Instead of using the characters and the standard format you can set the string to process using styles as seen below. -``` -$ echo "vhc:prettybox;Woooow I'm using prettybox!"|vhc - +`echo "vhc:prettybox;Woooow I'm using prettybox!"|vhc` produces output: +```text ┌─────────────────────────────┐ │ Woooow I'm using prettybox! │ └─────────────────────────────┘ - -$ ``` #### `sides` `echo "vhc:sides;Woooow I'm using sides!"|vhc` produces: -``` +```text ⎡ ⎤ ⎢ Woooow I'm using sides! ⎥ ⎣ ⎦ @@ -55,7 +52,7 @@ $ #### `prettybox` `echo "vhc:prettybox;Woooow I'm using prettybox!"|vhc` produces: -``` +```text ┌─────────────────────────────┐ │ Woooow I'm using prettybox! │ └─────────────────────────────┘ @@ -63,7 +60,7 @@ $ #### `quotes` `echo "vhc:quotes;Woooow I'm using quotes!"|vhc` produces: -``` +```text " Woooow I'm using quotes! " @@ -71,7 +68,7 @@ $ #### `ccomment` `echo "vhc:ccomment;Woooow I'm using ccomment!"|vhc` produces: -``` +```text /* * Woooow I'm using ccomment! */ @@ -79,7 +76,7 @@ $ #### `lcomment` `echo "vhc:lcomment;Woooow I'm using lcomment!"|vhc` produces: -``` +```text // // Woooow I'm using lcomment! // @@ -87,7 +84,7 @@ $ #### `box` `echo "vhc:box;Woooow I'm using box!"|vhc` produces: -``` +```text +-----------------------+ | Woooow I'm using box! | +-----------------------+ @@ -95,7 +92,7 @@ $ #### `star`, `stars` or `asterisk` `echo "vhc:stars;Woooow I'm using stars!"|vhc` produces: -``` +```text *************************** * Woooow I'm using stars! * *************************** @@ -103,7 +100,7 @@ $ #### Standart `ernjs` or `ernando` `echo "vhc:awesome;Woooow I'm using VHC!"|vhc` produces: -``` +```text ############################### #### Woooow I'm using VHC! #### ############################### From ebc6542301f8146ef73856405147e6162bffbe6a Mon Sep 17 00:00:00 2001 From: John Murowaniecki Date: Sat, 4 Jul 2020 16:04:26 -0300 Subject: [PATCH 6/7] provides installation, improved documentation and integration with github actions --- .github/workflows/quality.yml | 29 ++++ EXAMPLES.md | 177 ++++++++++++++++++++++++ Makefile | 136 ++++++++++++++++++ README.md | 97 ++++--------- tests/testing_style_asterisk.sh | 1 + tests/testing_style_asterisk.sh.result | 3 + tests/testing_style_box.sh | 1 + tests/testing_style_box.sh.result | 3 + tests/testing_style_cccomment.sh | 1 + tests/testing_style_cccomment.sh.result | 3 + tests/testing_style_ccomment.sh | 1 + tests/testing_style_ccomment.sh.result | 3 + tests/testing_style_docblock.sh | 1 + tests/testing_style_docblock.sh.result | 3 + tests/testing_style_ernando.sh | 1 + tests/testing_style_ernando.sh.result | 3 + tests/testing_style_ernjs.sh | 1 + tests/testing_style_ernjs.sh.result | 3 + tests/testing_style_lcomment.sh | 1 + tests/testing_style_lcomment.sh.result | 3 + tests/testing_style_pretty.sh | 1 + tests/testing_style_pretty.sh.result | 3 + tests/testing_style_prettybox.sh | 1 + tests/testing_style_prettybox.sh.result | 3 + tests/testing_style_quotes.sh | 1 + tests/testing_style_quotes.sh.result | 3 + tests/testing_style_sides.sh | 1 + tests/testing_style_sides.sh.result | 3 + tests/testing_style_star.sh | 1 + tests/testing_style_star.sh.result | 3 + tests/testing_style_stars.sh | 1 + tests/testing_style_stars.sh.result | 3 + vhc | 67 ++++----- 33 files changed, 461 insertions(+), 101 deletions(-) create mode 100644 .github/workflows/quality.yml create mode 100644 EXAMPLES.md create mode 100644 Makefile create mode 100644 tests/testing_style_asterisk.sh create mode 100644 tests/testing_style_asterisk.sh.result create mode 100644 tests/testing_style_box.sh create mode 100644 tests/testing_style_box.sh.result create mode 100644 tests/testing_style_cccomment.sh create mode 100644 tests/testing_style_cccomment.sh.result create mode 100644 tests/testing_style_ccomment.sh create mode 100644 tests/testing_style_ccomment.sh.result create mode 100644 tests/testing_style_docblock.sh create mode 100644 tests/testing_style_docblock.sh.result create mode 100644 tests/testing_style_ernando.sh create mode 100644 tests/testing_style_ernando.sh.result create mode 100644 tests/testing_style_ernjs.sh create mode 100644 tests/testing_style_ernjs.sh.result create mode 100644 tests/testing_style_lcomment.sh create mode 100644 tests/testing_style_lcomment.sh.result create mode 100644 tests/testing_style_pretty.sh create mode 100644 tests/testing_style_pretty.sh.result create mode 100644 tests/testing_style_prettybox.sh create mode 100644 tests/testing_style_prettybox.sh.result create mode 100644 tests/testing_style_quotes.sh create mode 100644 tests/testing_style_quotes.sh.result create mode 100644 tests/testing_style_sides.sh create mode 100644 tests/testing_style_sides.sh.result create mode 100644 tests/testing_style_star.sh create mode 100644 tests/testing_style_star.sh.result create mode 100644 tests/testing_style_stars.sh create mode 100644 tests/testing_style_stars.sh.result diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..d863bdb --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,29 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run Makefile tests + run: | + make samples + make tests \ No newline at end of file diff --git a/EXAMPLES.md b/EXAMPLES.md new file mode 100644 index 0000000..9ade689 --- /dev/null +++ b/EXAMPLES.md @@ -0,0 +1,177 @@ +# VIM Header Composer Examples + + > **Warning:** this file was generated by the execution of `make samples`, manual changes possible will be overwritten. + + Instead of using the characters and the standard format you can set the string to process using styles as seen below. + + + + +------ +### Using 'sides' + +Example using `./vhc <<< "vhc:sides;Example using 'sides'."`. +``` +⎡ ⎤ +⎢ Example using 'sides'. ⎥ +⎣ ⎦ +``` + + + +------ +### Using 'prettybox' + +Example using `./vhc <<< "vhc:prettybox;Example using 'prettybox'."`. +``` +┌────────────────────────────┐ +│ Example using 'prettybox'. │ +└────────────────────────────┘ +``` + + + +------ +### Using 'pretty' + +Example using `./vhc <<< "vhc:pretty;Example using 'pretty'."`. +``` +┌─────────────────────────┐ +│ Example using 'pretty'. │ +└─────────────────────────┘ +``` + + + +------ +### Using 'quotes' + +Example using `./vhc <<< "vhc:quotes;Example using 'quotes'."`. +``` + " + Example using 'quotes'. +" +``` + + + +------ +### Using 'docblock' + +Example using `./vhc <<< "vhc:docblock;Example using 'docblock'."`. +``` +/** + * Example using 'docblock'. + **/ +``` + + + +------ +### Using 'cccomment' + +Example using `./vhc <<< "vhc:cccomment;Example using 'cccomment'."`. +``` +/** + ** Example using 'cccomment'. + **/ +``` + + + +------ +### Using 'ccomment' + +Example using `./vhc <<< "vhc:ccomment;Example using 'ccomment'."`. +``` +/* + * Example using 'ccomment'. + */ +``` + + + +------ +### Using 'lcomment' + +Example using `./vhc <<< "vhc:lcomment;Example using 'lcomment'."`. +``` +// +// Example using 'lcomment'. +// +``` + + + +------ +### Using 'box' + +Example using `./vhc <<< "vhc:box;Example using 'box'."`. +``` ++----------------------+ +| Example using 'box'. | ++----------------------+ +``` + + + +------ +### Using 'star' + +Example using `./vhc <<< "vhc:star;Example using 'star'."`. +``` +************************* +* Example using 'star'. * +************************* +``` + + + +------ +### Using 'stars' + +Example using `./vhc <<< "vhc:stars;Example using 'stars'."`. +``` +************************** +* Example using 'stars'. * +************************** +``` + + + +------ +### Using 'asterisk' + +Example using `./vhc <<< "vhc:asterisk;Example using 'asterisk'."`. +``` +***************************** +* Example using 'asterisk'. * +***************************** +``` + + + +------ +### Using 'ernjs' + +Example using `./vhc <<< "vhc:ernjs;Example using 'ernjs'."`. +``` +################################ +#### Example using 'ernjs'. #### +################################ +``` + + + +------ +### Using 'ernando' + +Example using `./vhc <<< "vhc:ernando;Example using 'ernando'."`. +``` +################################## +#### Example using 'ernando'. #### +################################## +``` + + + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..081c6ec --- /dev/null +++ b/Makefile @@ -0,0 +1,136 @@ +# +# λ::Makefile +# +# For further information see `README.md`. + +PREFIX?= /bin +TARGET?= ~/.local +SOURCE?= vhc +NULL ?= /dev/null +VIMRC = ~/.vimrc + +INSTALL= $(TARGET)$(PREFIX) +VIMCONF= echo 'map :!vhc' >> $(VIMRC) + +ifneq (,$(DESTDIR)) +TARGET =$(DESTDIR) +endif + + +CMD = "\\e[1m%-10s\\e[0m%s\n" +STR = "\\e[0;2;3m%s\\e[0m\n" +HLP = sed -E 's/(`.*`)/\\e[1m\1\\e[0m/' + + +DEFAULT: help + + + +backup: + @\ + cp $(VIMRC) $(VIMRC)_$(shell date +'%Y%m%d%H%M%S') + + +# +install: backup # Installs application. + @\ + mkdir -p $(INSTALL) 2>$(NULL) ; \ + install -D $(SOURCE) $(INSTALL)/$(SOURCE) ; \ + chmod +x $(INSTALL)/$(SOURCE) ; \ + echo Installed into '$(INSTALL)/$(SOURCE)' + + @\ + LINE=$$(cat $(VIMRC)"" | grep -n "$(SOURCE)"\ + | awk -F':' '''{ print($$1); }'); (( sed -i \ + "$${LINE},1 s/^[\"| ]*//g" $(VIMRC))) + + @\ + VIM=$$(cat $(VIMRC)"" | grep "$(SOURCE)") ; \ + [ -e $(INSTALL)/$(SOURCE) -a -z "$${VIM}" ] \ + && ((echo 'Configuring VIM'; $(VIMCONF) )) \ + || ((echo "VIM configured with '$${VIM}'")) + + + +uninstall: backup # Uninstalls application. + @\ + rm -Rf $(INSTALL)/$(SOURCE); \ + echo "'$(INSTALL)/$(SOURCE)' removed." + + @\ + LINE=$$(cat $(VIMRC) | grep -n "$(SOURCE)" | awk -F':' '{print($$1)}'); \ + sed -i "$${LINE},1 s/^/\" /" $(VIMRC) + + +# +help: # Shows this help. + @\ + echo """"""""""""""""""""""""""" \ + $$(awk 'BEGIN { FS=":.*?#" } \ + /^(\w+:.*|)#/ { \ + gsub("^( : |)#( |)", """""""" ); \ + LEN=length($$2); COND=(LEN < 1); \ + FORMAT=(COND ? $(STR) : $(CMD)); \ + printf(FORMAT, $$1, """"""$$2 ); \ + }' $(MAKEFILE_LIST) | ($(HLP)))" + + +# +samples: # Build tests and EXAMPLES.md using possible style options. + @\ + mkdir -p tests; \ + NUM(){ cat vhc | grep -n "$${1}OPTIONS" | awk -F':' '{print($$1)}'; }; \ + INI=$$(NUM "# "); \ + END=$$(NUM "#/"); \ + MAX=$$(cat vhc | wc -l); \ + GET=$$((MAX - INI - 1)); \ + LEN=$$((END - INI - 3)); \ + TARGET=EXAMPLES.md \ + OPTIONS=$$(cat vhc \ + | tail -n"$${GET}" \ + | head -n"$${LEN}" \ + | sed -E 's/^\s+([a-z0-9\-\|\*]*)\).*$$/\1/; s/\|/ /g; s/\*//g'); \ + echo "# VIM Header Composer Examples\n\n" \ + "> **Warning:** this file was generated by the execution of \`make samples\`, manual changes possible will be overwritten.\n\n" \ + "Instead of using the characters and the standard format you can set the string to process using styles as seen below.\n\n\n\n" \ + > $$TARGET; \ + for opt in $$OPTIONS; \ + do TEST=tests/testing_style_$${opt}.sh; \ + echo "Creating test \e[1m$${opt}\e[0m.."; \ + echo "------\n### Using '$${opt}'\n" >> $$TARGET; \ + echo """./vhc <<< \"vhc:"$${opt}";Example using '$${opt}'.\"" > $${TEST}; \ + echo "Example using \`$$(cat $${TEST})\`.\n\`\`\`" >> $$TARGET; \ + echo "vhc:$${opt};Example using '$${opt}'." | ./vhc > $${TEST}.result;\ + echo "$$(cat $${TEST}.result)\n\`\`\`\n\n\n" >> $$TARGET; \ + done + + +# +.PHONY: tests +tests: # Execute tests. + @\ + gMD5(){ cat $$1 | md5sum | awk '{print($$1)}'; };\ + for each in ./tests/*.sh; \ + do bash "$${each}" >.test ; \ + TESTS=$$(echo $${each} | sed -E 's/_/ /g; s/\.sh$$//g; s/^.*\///'); \ + printf "%*s%s\r%s" 5 "" "$${TESTS}"; \ + VALID=$$(gMD5 ".test"); \ + CHECK=$$(gMD5 $${each}.result); \ + VALUE="\e[31mFail\e[0m"; \ + [ "$${VALID}" = "$${CHECK}" ] \ + && VALUE="\e[32mDone\e[0m" \ + || FAIL=true; \ + echo "$${VALUE}"; \ + done; \ + rm -Rf .test; \ + [ -z $${FAIL} ] || exit 1 + + + +clear: # Clear. + @\ + rm -Rf tests .test + +# +%: + @: diff --git a/README.md b/README.md index 07047cd..fbe1f10 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,14 @@ # VIM Header Composer -[![StyleCI](https://github.styleci.io/repos/103320898/shield?branch=master)](https://github.styleci.io/repos/103320898) -[![Codacy](https://api.codacy.com/project/badge/Grade/9ac72e1294504b06b245a7b4d8253029)](https://www.codacy.com/app/jmurowaniecki/vim-header-composer) +[url-codacy ]: https://www.codacy.com/app/jmurowaniecki/vim-header-composer +[ico-codacy ]: https://img.shields.io/codacy/grade/9ac72e1294504b06b245a7b4d8253029?logo=codacy&logoColor=green&style=flat-square +[url-styleci]: https://github.styleci.io/repos/103320898 +[ico-styleci]: https://github.styleci.io/repos/103320898/shield +[ico-version]: https://img.shields.io/github/v/tag/jmurowaniecki/vim-header-composer?sort=semver&style=flat-square + +[![StyleCI][ico-styleci]][url-styleci] +[![Codacy ][ico-codacy ]][url-codacy] +[![Version][ico-version]](#) VIM header composer is an utility script wrote in shell very simple to make header's based on comments in vim such as above. @@ -18,90 +25,40 @@ RUN scp -i bar example.com:/dev/null ## Installation +### Yes, you can do it by the old-fashioned way +Clonning this repository and linking it to your `.../bin/` folder. ```sh -git clone https://github.com/ernandos/vim-header-composer.git +git clone git@github.com:ernandojs/vim-header-composer.git sudo mv vim-header-composer /opt/ sudo ln -s /opt/vim-header-composer/vhc /usr/local/bin echo 'map :!vhc' >> ~/.vimrc ``` +### Makefile +You can also perform installation with `make install`. + + + ## Basic usage steps -1. Install this script globally; -2. Open any file using VI/VIM; -3. In normal VIM mode (press ), select the line with SHIT + V; -4. Press and ; +1. Install this script _globally or **not**_; +2. Open any file using **VI/VIM**; +3. In normal VIM mode (press ****); +4. Goto VISUAL mode (select the line - or lines - with **SHIT + V**); +5. Press **** then ****; + + ### Using styles Instead of using the characters and the standard format you can set the string to process using styles as seen below. -`echo "vhc:prettybox;Woooow I'm using prettybox!"|vhc` produces output: -```text -┌─────────────────────────────┐ -│ Woooow I'm using prettybox! │ -└─────────────────────────────┘ -``` - -#### `sides` -`echo "vhc:sides;Woooow I'm using sides!"|vhc` produces: -```text -⎡ ⎤ -⎢ Woooow I'm using sides! ⎥ -⎣ ⎦ -``` -#### `prettybox` -`echo "vhc:prettybox;Woooow I'm using prettybox!"|vhc` produces: +#### Prettybox +`vhc <<< "vhc:prettybox;Woooow I'm using prettybox!"` produces: ```text ┌─────────────────────────────┐ │ Woooow I'm using prettybox! │ └─────────────────────────────┘ ``` -#### `quotes` -`echo "vhc:quotes;Woooow I'm using quotes!"|vhc` produces: -```text - " - Woooow I'm using quotes! -" -``` - -#### `ccomment` -`echo "vhc:ccomment;Woooow I'm using ccomment!"|vhc` produces: -```text -/* -* Woooow I'm using ccomment! -*/ -``` - -#### `lcomment` -`echo "vhc:lcomment;Woooow I'm using lcomment!"|vhc` produces: -```text -// -// Woooow I'm using lcomment! -// -``` - -#### `box` -`echo "vhc:box;Woooow I'm using box!"|vhc` produces: -```text -+-----------------------+ -| Woooow I'm using box! | -+-----------------------+ -``` - -#### `star`, `stars` or `asterisk` -`echo "vhc:stars;Woooow I'm using stars!"|vhc` produces: -```text -*************************** -* Woooow I'm using stars! * -*************************** -``` - -#### Standart `ernjs` or `ernando` -`echo "vhc:awesome;Woooow I'm using VHC!"|vhc` produces: -```text -############################### -#### Woooow I'm using VHC! #### -############################### -``` +For further information about styles see [more examples](EXAMPLES.md). \ No newline at end of file diff --git a/tests/testing_style_asterisk.sh b/tests/testing_style_asterisk.sh new file mode 100644 index 0000000..7788b2d --- /dev/null +++ b/tests/testing_style_asterisk.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:asterisk;Example using 'asterisk'." diff --git a/tests/testing_style_asterisk.sh.result b/tests/testing_style_asterisk.sh.result new file mode 100644 index 0000000..1816011 --- /dev/null +++ b/tests/testing_style_asterisk.sh.result @@ -0,0 +1,3 @@ +***************************** +* Example using 'asterisk'. * +***************************** diff --git a/tests/testing_style_box.sh b/tests/testing_style_box.sh new file mode 100644 index 0000000..a327a38 --- /dev/null +++ b/tests/testing_style_box.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:box;Example using 'box'." diff --git a/tests/testing_style_box.sh.result b/tests/testing_style_box.sh.result new file mode 100644 index 0000000..eadfb1a --- /dev/null +++ b/tests/testing_style_box.sh.result @@ -0,0 +1,3 @@ ++----------------------+ +| Example using 'box'. | ++----------------------+ diff --git a/tests/testing_style_cccomment.sh b/tests/testing_style_cccomment.sh new file mode 100644 index 0000000..1af5597 --- /dev/null +++ b/tests/testing_style_cccomment.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:cccomment;Example using 'cccomment'." diff --git a/tests/testing_style_cccomment.sh.result b/tests/testing_style_cccomment.sh.result new file mode 100644 index 0000000..e2cbaca --- /dev/null +++ b/tests/testing_style_cccomment.sh.result @@ -0,0 +1,3 @@ +/** + ** Example using 'cccomment'. + **/ diff --git a/tests/testing_style_ccomment.sh b/tests/testing_style_ccomment.sh new file mode 100644 index 0000000..d360f39 --- /dev/null +++ b/tests/testing_style_ccomment.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:ccomment;Example using 'ccomment'." diff --git a/tests/testing_style_ccomment.sh.result b/tests/testing_style_ccomment.sh.result new file mode 100644 index 0000000..9ce2ebc --- /dev/null +++ b/tests/testing_style_ccomment.sh.result @@ -0,0 +1,3 @@ +/* + * Example using 'ccomment'. + */ diff --git a/tests/testing_style_docblock.sh b/tests/testing_style_docblock.sh new file mode 100644 index 0000000..1bf01b3 --- /dev/null +++ b/tests/testing_style_docblock.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:docblock;Example using 'docblock'." diff --git a/tests/testing_style_docblock.sh.result b/tests/testing_style_docblock.sh.result new file mode 100644 index 0000000..230b12d --- /dev/null +++ b/tests/testing_style_docblock.sh.result @@ -0,0 +1,3 @@ +/** + * Example using 'docblock'. + **/ diff --git a/tests/testing_style_ernando.sh b/tests/testing_style_ernando.sh new file mode 100644 index 0000000..309f268 --- /dev/null +++ b/tests/testing_style_ernando.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:ernando;Example using 'ernando'." diff --git a/tests/testing_style_ernando.sh.result b/tests/testing_style_ernando.sh.result new file mode 100644 index 0000000..ba5c307 --- /dev/null +++ b/tests/testing_style_ernando.sh.result @@ -0,0 +1,3 @@ +################################## +#### Example using 'ernando'. #### +################################## diff --git a/tests/testing_style_ernjs.sh b/tests/testing_style_ernjs.sh new file mode 100644 index 0000000..29ddbb9 --- /dev/null +++ b/tests/testing_style_ernjs.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:ernjs;Example using 'ernjs'." diff --git a/tests/testing_style_ernjs.sh.result b/tests/testing_style_ernjs.sh.result new file mode 100644 index 0000000..b74d7ee --- /dev/null +++ b/tests/testing_style_ernjs.sh.result @@ -0,0 +1,3 @@ +################################ +#### Example using 'ernjs'. #### +################################ diff --git a/tests/testing_style_lcomment.sh b/tests/testing_style_lcomment.sh new file mode 100644 index 0000000..67b322a --- /dev/null +++ b/tests/testing_style_lcomment.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:lcomment;Example using 'lcomment'." diff --git a/tests/testing_style_lcomment.sh.result b/tests/testing_style_lcomment.sh.result new file mode 100644 index 0000000..cf9f6e3 --- /dev/null +++ b/tests/testing_style_lcomment.sh.result @@ -0,0 +1,3 @@ +// +// Example using 'lcomment'. +// diff --git a/tests/testing_style_pretty.sh b/tests/testing_style_pretty.sh new file mode 100644 index 0000000..a0144df --- /dev/null +++ b/tests/testing_style_pretty.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:pretty;Example using 'pretty'." diff --git a/tests/testing_style_pretty.sh.result b/tests/testing_style_pretty.sh.result new file mode 100644 index 0000000..4d0a6a4 --- /dev/null +++ b/tests/testing_style_pretty.sh.result @@ -0,0 +1,3 @@ +┌─────────────────────────┐ +│ Example using 'pretty'. │ +└─────────────────────────┘ diff --git a/tests/testing_style_prettybox.sh b/tests/testing_style_prettybox.sh new file mode 100644 index 0000000..c8db5c8 --- /dev/null +++ b/tests/testing_style_prettybox.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:prettybox;Example using 'prettybox'." diff --git a/tests/testing_style_prettybox.sh.result b/tests/testing_style_prettybox.sh.result new file mode 100644 index 0000000..8f5c430 --- /dev/null +++ b/tests/testing_style_prettybox.sh.result @@ -0,0 +1,3 @@ +┌────────────────────────────┐ +│ Example using 'prettybox'. │ +└────────────────────────────┘ diff --git a/tests/testing_style_quotes.sh b/tests/testing_style_quotes.sh new file mode 100644 index 0000000..9e8bd3e --- /dev/null +++ b/tests/testing_style_quotes.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:quotes;Example using 'quotes'." diff --git a/tests/testing_style_quotes.sh.result b/tests/testing_style_quotes.sh.result new file mode 100644 index 0000000..e763f6b --- /dev/null +++ b/tests/testing_style_quotes.sh.result @@ -0,0 +1,3 @@ + " + Example using 'quotes'. +" diff --git a/tests/testing_style_sides.sh b/tests/testing_style_sides.sh new file mode 100644 index 0000000..ecf2fbb --- /dev/null +++ b/tests/testing_style_sides.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:sides;Example using 'sides'." diff --git a/tests/testing_style_sides.sh.result b/tests/testing_style_sides.sh.result new file mode 100644 index 0000000..57684f1 --- /dev/null +++ b/tests/testing_style_sides.sh.result @@ -0,0 +1,3 @@ +⎡ ⎤ +⎢ Example using 'sides'. ⎥ +⎣ ⎦ diff --git a/tests/testing_style_star.sh b/tests/testing_style_star.sh new file mode 100644 index 0000000..151b8e7 --- /dev/null +++ b/tests/testing_style_star.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:star;Example using 'star'." diff --git a/tests/testing_style_star.sh.result b/tests/testing_style_star.sh.result new file mode 100644 index 0000000..8fa92a2 --- /dev/null +++ b/tests/testing_style_star.sh.result @@ -0,0 +1,3 @@ +************************* +* Example using 'star'. * +************************* diff --git a/tests/testing_style_stars.sh b/tests/testing_style_stars.sh new file mode 100644 index 0000000..1782271 --- /dev/null +++ b/tests/testing_style_stars.sh @@ -0,0 +1 @@ +./vhc <<< "vhc:stars;Example using 'stars'." diff --git a/tests/testing_style_stars.sh.result b/tests/testing_style_stars.sh.result new file mode 100644 index 0000000..770a987 --- /dev/null +++ b/tests/testing_style_stars.sh.result @@ -0,0 +1,3 @@ +************************** +* Example using 'stars'. * +************************** diff --git a/vhc b/vhc index e0b6278..f677e10 100755 --- a/vhc +++ b/vhc @@ -1,6 +1,4 @@ #!/usr/bin/env bash -# -# wat if we have more than one template? temporary=$(mktemp) || exit 1 _e='echo -e' @@ -8,50 +6,57 @@ option= string= size=0 -function config { - search='s/vhc:([a-zA-Z0-9,]*);(.*)$/' - option=$($_e "$1"|sed -r "${search}"'\1/') - string=$($_e "$1"|sed -r "${search}"'\2/') + + +config() { + search="s/[vhc|λ]+:([a-zA-Z0-9,]*);(.*)\$/""" + option=$($_e "${1}" | sed -r "${search}"'\1/') + string=$($_e "${1}" | sed -r "${search}"'\2/') + strlen=${#string} } -while read -r string -do [[ "${string:0:4}" == "vhc:" ]] && config "${string}" - [[ ${#string} -gt ${size} ]] && size=${#string} - $_e "${string}" >> "${temporary}" +while read -r string +do config """${string}" + $_e """""${string}" >> "${temporary}" + [[ 0 -lt ${strlen} ]] && size=${strlen} done +# OPTIONS case "${option,,}" in - sides) adjust=2; corner=('⎣' '⎦' '⎡' '⎤'); lines=(' ' ' ⎥' ' ' '⎢ ' );; - prettybox) adjust=2; corner=('└' '┘' '┌' '┐'); lines=('─' ' │' '─' '│ ' );; - quotes) adjust=2; corner=('"' ' ' ' ' '"'); lines=(' ' ' ' ' ' ' ' );; - ccomment) adjust=2; corner=(' */' ' ' '/*' ' '); lines=(' ' ' ' ' ' ' * ');; - lcomment) adjust=2; corner=('//' ' ' '//' ' '); lines=(' ' ' ' ' ' '// ');; - box) adjust=2; corner=('+' '+' '+' '+'); lines=('-' ' |' '-' '| ' );; - star|stars|asterisk) adjust=2; corner=('*' '*' '*' '*'); lines=('*' ' *' '*' '* ' );; - ernjs|ernando|*) adjust=8; corner=('#' '#' '#' '#'); lines=('#' ' ####' '#' '#### ') + sides) adjust=2; corner=('⎣' '⎦' '⎡' '⎤'); lines=(' ' ' ⎥' ' ' '⎢ ' );; + prettybox|pretty) adjust=2; corner=('└' '┘' '┌' '┐'); lines=('─' ' │' '─' '│ ' );; + quotes) adjust=2; corner=('"' ' ' ' ' '"'); lines=(' ' ' ' ' ' ' ' );; + docblock) adjust=2; corner=(' **/' ' ' '/**' ' '); lines=(' ' ' ' ' ' ' * ' );; + cccomment) adjust=2; corner=(' **/' ' ' '/**' ' '); lines=(' ' ' ' ' ' ' ** ' );; + ccomment) adjust=2; corner=(' */' ' ' '/*' ' '); lines=(' ' ' ' ' ' ' * ' );; + lcomment) adjust=2; corner=('//' ' ' '//' ' '); lines=(' ' ' ' ' ' '// ' );; + box) adjust=2; corner=('+' '+' '+' '+'); lines=('-' ' |' '-' '| ' );; + star|stars|asterisk) adjust=2; corner=('*' '*' '*' '*'); lines=('*' ' *' '*' '* ' );; + ernjs|ernando|*) adjust=8; corner=('#' '#' '#' '#'); lines=('#' ' ####' '#' '#### ') esac +#/OPTIONS -function str_repeat { - n=$1 - while [[ $n -gt 0 ]] - do $_e -n "$2" - n=$(( n - 1 )) +str_repeat() { + n="${1}" + while [[ ${n} -gt 0 ]] + do $_e -n "${2}" + n=$(( n - 1 )) done } -function line { +line() { [ $# -eq 1 ] \ - && str_repeat "$((size + adjust))" "$1" \ - && exit + && str_repeat "$((size + adjust))" "${1}" \ + && exit - $_e "${corner[$1]}$(line "${lines[$1]}")${corner[$2]}" + $_e "${corner[${1}]}$(line "${lines[${1}]}")${corner[${2}]}" } -function line_top { +line_top() { line 0 1 } -function line_bottom { +line_bottom() { line 2 3 } @@ -59,7 +64,7 @@ trap line_top \ EXIT; line_bottom while read -r string -do spacing=$(printf '%*s' $((size - ${#string}))) - $_e "${lines[3]}${string}${spacing}${lines[1]}" +do tab=$(printf '%*s' $((size - ${#string})) "") + $_e "${lines[3]}${string}${tab}${lines[1]}" done < "${temporary}" rm "${temporary}" From a42a27ad2a90bd10001dc9547cb499f3ec93c23d Mon Sep 17 00:00:00 2001 From: John Murowaniecki Date: Sat, 4 Jul 2020 16:10:13 -0300 Subject: [PATCH 7/7] samples regenerated --- EXAMPLES.md | 56 ++++++++++++++++++++++++-------- Makefile | 2 +- tests/testing_style_asterisk.sh | 2 ++ tests/testing_style_box.sh | 2 ++ tests/testing_style_cccomment.sh | 2 ++ tests/testing_style_ccomment.sh | 2 ++ tests/testing_style_docblock.sh | 2 ++ tests/testing_style_ernando.sh | 2 ++ tests/testing_style_ernjs.sh | 2 ++ tests/testing_style_lcomment.sh | 2 ++ tests/testing_style_pretty.sh | 2 ++ tests/testing_style_prettybox.sh | 2 ++ tests/testing_style_quotes.sh | 2 ++ tests/testing_style_sides.sh | 2 ++ tests/testing_style_star.sh | 2 ++ tests/testing_style_stars.sh | 2 ++ 16 files changed, 71 insertions(+), 15 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index 9ade689..271992a 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -10,7 +10,9 @@ ------ ### Using 'sides' -Example using `./vhc <<< "vhc:sides;Example using 'sides'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:sides;Example using 'sides'."`. ``` ⎡ ⎤ ⎢ Example using 'sides'. ⎥ @@ -22,7 +24,9 @@ Example using `./vhc <<< "vhc:sides;Example using 'sides'."`. ------ ### Using 'prettybox' -Example using `./vhc <<< "vhc:prettybox;Example using 'prettybox'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:prettybox;Example using 'prettybox'."`. ``` ┌────────────────────────────┐ │ Example using 'prettybox'. │ @@ -34,7 +38,9 @@ Example using `./vhc <<< "vhc:prettybox;Example using 'prettybox'."`. ------ ### Using 'pretty' -Example using `./vhc <<< "vhc:pretty;Example using 'pretty'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:pretty;Example using 'pretty'."`. ``` ┌─────────────────────────┐ │ Example using 'pretty'. │ @@ -46,7 +52,9 @@ Example using `./vhc <<< "vhc:pretty;Example using 'pretty'."`. ------ ### Using 'quotes' -Example using `./vhc <<< "vhc:quotes;Example using 'quotes'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:quotes;Example using 'quotes'."`. ``` " Example using 'quotes'. @@ -58,7 +66,9 @@ Example using `./vhc <<< "vhc:quotes;Example using 'quotes'."`. ------ ### Using 'docblock' -Example using `./vhc <<< "vhc:docblock;Example using 'docblock'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:docblock;Example using 'docblock'."`. ``` /** * Example using 'docblock'. @@ -70,7 +80,9 @@ Example using `./vhc <<< "vhc:docblock;Example using 'docblock'."`. ------ ### Using 'cccomment' -Example using `./vhc <<< "vhc:cccomment;Example using 'cccomment'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:cccomment;Example using 'cccomment'."`. ``` /** ** Example using 'cccomment'. @@ -82,7 +94,9 @@ Example using `./vhc <<< "vhc:cccomment;Example using 'cccomment'."`. ------ ### Using 'ccomment' -Example using `./vhc <<< "vhc:ccomment;Example using 'ccomment'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:ccomment;Example using 'ccomment'."`. ``` /* * Example using 'ccomment'. @@ -94,7 +108,9 @@ Example using `./vhc <<< "vhc:ccomment;Example using 'ccomment'."`. ------ ### Using 'lcomment' -Example using `./vhc <<< "vhc:lcomment;Example using 'lcomment'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:lcomment;Example using 'lcomment'."`. ``` // // Example using 'lcomment'. @@ -106,7 +122,9 @@ Example using `./vhc <<< "vhc:lcomment;Example using 'lcomment'."`. ------ ### Using 'box' -Example using `./vhc <<< "vhc:box;Example using 'box'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:box;Example using 'box'."`. ``` +----------------------+ | Example using 'box'. | @@ -118,7 +136,9 @@ Example using `./vhc <<< "vhc:box;Example using 'box'."`. ------ ### Using 'star' -Example using `./vhc <<< "vhc:star;Example using 'star'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:star;Example using 'star'."`. ``` ************************* * Example using 'star'. * @@ -130,7 +150,9 @@ Example using `./vhc <<< "vhc:star;Example using 'star'."`. ------ ### Using 'stars' -Example using `./vhc <<< "vhc:stars;Example using 'stars'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:stars;Example using 'stars'."`. ``` ************************** * Example using 'stars'. * @@ -142,7 +164,9 @@ Example using `./vhc <<< "vhc:stars;Example using 'stars'."`. ------ ### Using 'asterisk' -Example using `./vhc <<< "vhc:asterisk;Example using 'asterisk'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:asterisk;Example using 'asterisk'."`. ``` ***************************** * Example using 'asterisk'. * @@ -154,7 +178,9 @@ Example using `./vhc <<< "vhc:asterisk;Example using 'asterisk'."`. ------ ### Using 'ernjs' -Example using `./vhc <<< "vhc:ernjs;Example using 'ernjs'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:ernjs;Example using 'ernjs'."`. ``` ################################ #### Example using 'ernjs'. #### @@ -166,7 +192,9 @@ Example using `./vhc <<< "vhc:ernjs;Example using 'ernjs'."`. ------ ### Using 'ernando' -Example using `./vhc <<< "vhc:ernando;Example using 'ernando'."`. +Example using `#!/usr/bin/env bash + +./vhc <<< "vhc:ernando;Example using 'ernando'."`. ``` ################################## #### Example using 'ernando'. #### diff --git a/Makefile b/Makefile index 081c6ec..bd4f902 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ samples: # Build tests and EXAMPLES.md using possible style options. do TEST=tests/testing_style_$${opt}.sh; \ echo "Creating test \e[1m$${opt}\e[0m.."; \ echo "------\n### Using '$${opt}'\n" >> $$TARGET; \ - echo """./vhc <<< \"vhc:"$${opt}";Example using '$${opt}'.\"" > $${TEST}; \ + echo "#!/usr/bin/env bash\n\n""./vhc <<< \"vhc:"$${opt}";Example using '$${opt}'.\"" > $${TEST}; \ echo "Example using \`$$(cat $${TEST})\`.\n\`\`\`" >> $$TARGET; \ echo "vhc:$${opt};Example using '$${opt}'." | ./vhc > $${TEST}.result;\ echo "$$(cat $${TEST}.result)\n\`\`\`\n\n\n" >> $$TARGET; \ diff --git a/tests/testing_style_asterisk.sh b/tests/testing_style_asterisk.sh index 7788b2d..1351517 100644 --- a/tests/testing_style_asterisk.sh +++ b/tests/testing_style_asterisk.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:asterisk;Example using 'asterisk'." diff --git a/tests/testing_style_box.sh b/tests/testing_style_box.sh index a327a38..0a6b40a 100644 --- a/tests/testing_style_box.sh +++ b/tests/testing_style_box.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:box;Example using 'box'." diff --git a/tests/testing_style_cccomment.sh b/tests/testing_style_cccomment.sh index 1af5597..a4b4f34 100644 --- a/tests/testing_style_cccomment.sh +++ b/tests/testing_style_cccomment.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:cccomment;Example using 'cccomment'." diff --git a/tests/testing_style_ccomment.sh b/tests/testing_style_ccomment.sh index d360f39..57b2d41 100644 --- a/tests/testing_style_ccomment.sh +++ b/tests/testing_style_ccomment.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:ccomment;Example using 'ccomment'." diff --git a/tests/testing_style_docblock.sh b/tests/testing_style_docblock.sh index 1bf01b3..7d991b3 100644 --- a/tests/testing_style_docblock.sh +++ b/tests/testing_style_docblock.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:docblock;Example using 'docblock'." diff --git a/tests/testing_style_ernando.sh b/tests/testing_style_ernando.sh index 309f268..fcdee27 100644 --- a/tests/testing_style_ernando.sh +++ b/tests/testing_style_ernando.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:ernando;Example using 'ernando'." diff --git a/tests/testing_style_ernjs.sh b/tests/testing_style_ernjs.sh index 29ddbb9..439055f 100644 --- a/tests/testing_style_ernjs.sh +++ b/tests/testing_style_ernjs.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:ernjs;Example using 'ernjs'." diff --git a/tests/testing_style_lcomment.sh b/tests/testing_style_lcomment.sh index 67b322a..4d340d5 100644 --- a/tests/testing_style_lcomment.sh +++ b/tests/testing_style_lcomment.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:lcomment;Example using 'lcomment'." diff --git a/tests/testing_style_pretty.sh b/tests/testing_style_pretty.sh index a0144df..286e92e 100644 --- a/tests/testing_style_pretty.sh +++ b/tests/testing_style_pretty.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:pretty;Example using 'pretty'." diff --git a/tests/testing_style_prettybox.sh b/tests/testing_style_prettybox.sh index c8db5c8..80981b2 100644 --- a/tests/testing_style_prettybox.sh +++ b/tests/testing_style_prettybox.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:prettybox;Example using 'prettybox'." diff --git a/tests/testing_style_quotes.sh b/tests/testing_style_quotes.sh index 9e8bd3e..728f91e 100644 --- a/tests/testing_style_quotes.sh +++ b/tests/testing_style_quotes.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:quotes;Example using 'quotes'." diff --git a/tests/testing_style_sides.sh b/tests/testing_style_sides.sh index ecf2fbb..99f0cd8 100644 --- a/tests/testing_style_sides.sh +++ b/tests/testing_style_sides.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:sides;Example using 'sides'." diff --git a/tests/testing_style_star.sh b/tests/testing_style_star.sh index 151b8e7..39c6418 100644 --- a/tests/testing_style_star.sh +++ b/tests/testing_style_star.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:star;Example using 'star'." diff --git a/tests/testing_style_stars.sh b/tests/testing_style_stars.sh index 1782271..43ad26f 100644 --- a/tests/testing_style_stars.sh +++ b/tests/testing_style_stars.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + ./vhc <<< "vhc:stars;Example using 'stars'."