Skip to content

Commit 2874852

Browse files
updating documentation
2 parents ef31dbe + b4f34c6 commit 2874852

File tree

2 files changed

+216
-2
lines changed

2 files changed

+216
-2
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ scripts and Terminal users interfaces(TUI).
1515
Table of contents
1616
---------------------------
1717

18+
* [Overview](#overview)
19+
* [Table of contents](#table-of-contents)
1820
* [Installation](#installation)
1921
* [Usage](#usage)
2022
* [Files](#files)
2123
* [Features](#features)
24+
* [Communication](#communication)
2225
* [Dependencies](#dependencies)
2326

27+
2428
Installation
2529
-----------------------------------------------
2630

@@ -50,6 +54,9 @@ curl -sL https://github.com/gavinlyonsrepo/bashmultitool/archive/1.5.tar.gz | ta
5054
cd bashmultitool-1.5
5155
sudo make install
5256
```
57+
**Arch based System**
58+
59+
It's also available in the Arch Linux user repo AUR
5360

5461
Usage
5562
-------------------------------------------
@@ -62,6 +69,7 @@ do
6269
source "$MYFILE"
6370
done
6471

72+
6573
```
6674

6775
There are six files in library and they are independent of each other
@@ -70,6 +78,8 @@ dependent on print.
7078

7179
Each file has one function, To access functions from your shell scripts type:
7280

81+
82+
7383
```sh
7484
[functionname] [keyword] [options]
7585
```
@@ -160,7 +170,27 @@ Example Output:
160170

161171

162172
Dependencies
163-
------------------------------------
164-
1. GNU bash, version 4.4.20
173+
-------------------------------------
174+
1. GNU bash, version 4.4.18-2
165175

166176
2. The check website section requires netcat installed. [Netcat](https://en.wikipedia.org/wiki/Netcat)
177+
178+
179+
Communication
180+
-----------
181+
If you should find a bug or you have any other query,
182+
please send a report.
183+
Pull requests, suggestions for improvements
184+
and new features welcome.
185+
* Contact: Upstream repo at github site below or [email protected]
186+
* Upstream repository: [bashmultitool](https://github.com/gavinlyonsrepo/bashmultitool)
187+
188+
History
189+
------------------
190+
* See changelog.md in documentation section for version control history
191+
192+
Copyright
193+
---------
194+
Copyright (C) 2018 Gavin Lyons MIT expat
195+
See LICENSE.md in documentation section
196+
for more details

README.md.orig

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
2+
Overview
3+
--------------------------------------------
4+
* Name: bashmultitool
5+
* Title : Bash Shell library for commonly used functions.
6+
* Description: A Bash Shell library file for commonly used functions
7+
can be imported into shell scripts to create functional and colorful
8+
scripts and Terminal users interfaces(TUI).
9+
* Author: Gavin Lyons
10+
<<<<<<< HEAD
11+
* Communication: Upstream repo at github site below or [email protected]
12+
* URL: [bashmultitool](https://github.com/gavinlyonsrepo/bashmultitool)
13+
* History: See changelog.md in documentation section for version control history.
14+
* Copyright: Copyright (C) 2018 Gavin Lyons. See LICENSE.md in documentation section.
15+
=======
16+
* Contact: Upstream repo at github site below or [email protected]
17+
* Upstream repository: [bashmultitool](https://github.com/gavinlyonsrepo/bashmultitool)
18+
* History: See changelog.md in documentation section for version control history
19+
* Copyright: Copyright (C) 2018 Gavin Lyons MIT expat See LICENSE.md in documentation section
20+
21+
>>>>>>> b4f34c6ba31e6f36a298cfa19993f71b488d068d
22+
23+
Table of contents
24+
---------------------------
25+
26+
* [Installation](#installation)
27+
* [Usage](#usage)
28+
* [Files](#files)
29+
* [Features](#features)
30+
* [Dependencies](#dependencies)
31+
<<<<<<< HEAD
32+
=======
33+
34+
>>>>>>> b4f34c6ba31e6f36a298cfa19993f71b488d068d
35+
36+
Installation
37+
-----------------------------------------------
38+
39+
**Linux debian based systems built on Ubuntu 18.04 LTS (Bionic Beaver)**
40+
41+
A Personal Package Archives (PPA) has been created on Ubuntu
42+
package building and hosting section of launchpad site
43+
called bashmultitool.
44+
45+
To install this on your system run commands in terminal
46+
47+
```sh
48+
sudo add-apt-repository ppa:typematrix/bashmultitool
49+
sudo apt update
50+
sudo apt install bashmultitool
51+
```
52+
53+
**For other linux systems**
54+
55+
Download latest fixed release and run the makefile as per
56+
terminal commands below for version 1.5 latest release at time of writing
57+
Note: If you install with this method you will not be informed of updates
58+
by system.
59+
60+
```sh
61+
curl -sL https://github.com/gavinlyonsrepo/bashmultitool/archive/1.5.tar.gz | tar xz
62+
cd bashmultitool-1.5
63+
sudo make install
64+
```
65+
**Arch based System**
66+
67+
<<<<<<< HEAD
68+
=======
69+
It's also available in the Arch Linux user repo AUR
70+
71+
>>>>>>> b4f34c6ba31e6f36a298cfa19993f71b488d068d
72+
Usage
73+
-------------------------------------------
74+
Source the library from your bash shell scripts like so:
75+
76+
```sh
77+
LIBPATH="/usr/lib/bashmultitool/"
78+
for MYFILE in "$LIBPATH"*;
79+
do
80+
source "$MYFILE"
81+
done
82+
83+
```
84+
85+
There are six files in library and they are independent of each other
86+
you can source them individually if you wish, however the prompt file *is*
87+
dependent on print.
88+
89+
Each file has one function, To access functions from your shell scripts type:
90+
91+
```sh
92+
[functionname] [keyword] [options]
93+
```
94+
95+
Six separate markdown help files with detailed information,
96+
in documentation folder are available.
97+
For shortcut to each file click on link in 2nd table in *Files and setup* section below.
98+
The repo also contains a test folder where test files used in development are available.
99+
100+
A script to print library meta data for test and debug is also installed.
101+
102+
Files and setup
103+
-----------------------------------------
104+
105+
| File Path | Description |
106+
| ------ | ------ |
107+
| /usr/bin/bashmultitool.sh | Script to print library meta data |
108+
| /usr/lib/bashmultitool/bashmultitool/* | 6 library files see next table|
109+
| /usr/lib/bashmultitool/doc/README.md | help |
110+
| /usr/lib/bashmultitool/doc/documentation/license.md | copyright |
111+
| /usr/lib/bashmultitool/doc/documentation/changelog.md | history |
112+
113+
114+
| Library file | Function | Sections | Content | Doc link |
115+
| ---- | ---- | ---- | ---- | ---- |
116+
| bmtPrint | bmtPrintFunc | 101 | Printing text | [bmtPrint help file](documentation/bmtPrint.md)|
117+
| bmtPrompt | bmtPromptFunc | 201-207 | Prompts | [ bmtPrompt help file](documentation/bmtPrompt.md)|
118+
| bmtMisc | bmtMiscFunc | 301-304 | Miscellaneous | [bmtMisc help file](documentation/bmtMisc.md)|
119+
| bmtLinux | bmtLinuxFunc | 401-404 | Linux related | [bmtLinux help file](documentation/bmtLinux.md)|
120+
| bmtFiles | bmtFilesFunc | 501-505 | File related | [bmtFiles help file](documentation/bmtFiles.md)|
121+
| bmtData | btmDataFunc | 601-606 | Data related | [bmtData help file](documentation/bmtData.md)|
122+
123+
124+
Features
125+
----------------------
126+
The library contains six files and six functions,
127+
which contains 27 sections in total.
128+
The sections are grouped in six files as per logical function.
129+
Printing, prompting, Linux related, file related,
130+
data related and miscellaneous.
131+
132+
133+
## Section numbered list
134+
135+
* 101 Coloured printed text, 8 colours, 7 modes. 56 options in total.
136+
137+
Colours: Black, Red, Green, Yellow, Blue, Purple, Cyan, White.
138+
139+
Modes: normal, bold, underline, background, hiy, bold hiy, background hiy.
140+
141+
Note: hiy = high intensity.
142+
143+
Example Output:
144+
145+
![ScreenShot](https://raw.githubusercontent.com/gavinlyonsrepo/bashmultitool/master/screenshot/colour_print_example.png)
146+
147+
148+
* 201 Horizontal lines across terminal in any colour
149+
* 202 yes-no-quit [y/n/q] prompt
150+
* 203 YES-no [Y/n] prompt
151+
* 204 yes-NO [y/N] prompt
152+
* 205 Anykey to continue prompt in any colour
153+
* 206 QUIT-no [Q/n] prompt
154+
* 207 quit-NO [q/N] prompt
155+
156+
* 301 Check if a website is up
157+
* 302 Spinner Animation for long non-verbose commands
158+
* 303 Stopwatch / timer
159+
* 304 Weather forecast
160+
161+
* 401 Check package installed
162+
* 402 Linux distro family checker
163+
* 403 Set text editor $EDITOR if not set
164+
* 404 log file handler
165+
166+
* 501 Make and enter a formated directory
167+
* 502 check if directory exists and empty
168+
* 503 directory exists
169+
* 504 file exists
170+
* 505 device exists
171+
172+
* 601 integer user input check
173+
* 602 alphabet user input check
174+
* 603 alphanumeric user input check
175+
* 604 convert string to lowercase
176+
* 605 convert string to uppercase
177+
* 606 trim whitespace from string
178+
179+
180+
Dependencies
181+
------------------------------------
182+
1. GNU bash, version 4.4.20
183+
184+
2. The check website section requires netcat installed. [Netcat](https://en.wikipedia.org/wiki/Netcat)

0 commit comments

Comments
 (0)