dev.md: updated documentation
This commit is contained in:
44
doc/dev.md
44
doc/dev.md
@@ -17,6 +17,7 @@
|
|||||||
- [4.2. Function](#42-function)
|
- [4.2. Function](#42-function)
|
||||||
- [4.2.1. ```blank_disk <bloc_device> [--full]```](#421-blank_disk-bloc_device---full)
|
- [4.2.1. ```blank_disk <bloc_device> [--full]```](#421-blank_disk-bloc_device---full)
|
||||||
- [4.2.2. ```is_blank <bloc_device>```](#422-is_blank--bloc_device)
|
- [4.2.2. ```is_blank <bloc_device>```](#422-is_blank--bloc_device)
|
||||||
|
- [4.2.3. ```mkparts <disk> [dos|gpt] [size_part1 [... size_partN]]```](#423-mkparts--disk-dosgpt-size_part1--size_partn)
|
||||||
- [4.3. Other functionnalities](#43-other-functionnalities)
|
- [4.3. Other functionnalities](#43-other-functionnalities)
|
||||||
- [5. The command_line.sh file](#5-the-command_linesh-file)
|
- [5. The command_line.sh file](#5-the-command_linesh-file)
|
||||||
- [5.1. Functions](#51-functions)
|
- [5.1. Functions](#51-functions)
|
||||||
@@ -80,7 +81,13 @@
|
|||||||
- [12.1.2. ```function_exists <function_name>```](#1212-function_exists-function_name)
|
- [12.1.2. ```function_exists <function_name>```](#1212-function_exists-function_name)
|
||||||
- [12.1.3. ```get_mod_name <module_file>```](#1213-get_mod_name-module_file)
|
- [12.1.3. ```get_mod_name <module_file>```](#1213-get_mod_name-module_file)
|
||||||
- [12.1.4. ```set_system_proxy```](#1214-set_system_proxy)
|
- [12.1.4. ```set_system_proxy```](#1214-set_system_proxy)
|
||||||
|
- [12.2. Other functionnalities](#122-other-functionnalities)
|
||||||
|
- [13. The version.sh file](#13-the-versionsh-file)
|
||||||
|
- [13.1. Functions](#131-functions)
|
||||||
|
- [13.1.1. ```get_os_version```](#1311-get_os_version)
|
||||||
|
- [13.1.2. ```set_sys_var <arch> <dist> <version> <codename>```](#1312-set_sys_var-arch-dist-version-codename)
|
||||||
|
- [13.2. Other functionnalities](#132-other-functionnalities)
|
||||||
|
- [14. Writing conventions](#14-writing-conventions)
|
||||||
## 1. Getting started
|
## 1. Getting started
|
||||||
This is a developer's reference. It's not intended to be a manual, but a
|
This is a developer's reference. It's not intended to be a manual, but a
|
||||||
reference for all internal functions, so you can easily build your own modules.
|
reference for all internal functions, so you can easily build your own modules.
|
||||||
@@ -736,6 +743,41 @@ The ```SYS_CODE``` variable won't be set if your distribution provides no codena
|
|||||||
### 13.2. Other functionnalities
|
### 13.2. Other functionnalities
|
||||||
That file don't provide any other thing that the previously listed functions.
|
That file don't provide any other thing that the previously listed functions.
|
||||||
|
|
||||||
|
## 14. Writing conventions
|
||||||
|
For readability and compatibility purpose, I adopted some writing conventions.
|
||||||
|
First of all indentation is made with space only, as different editors can have
|
||||||
|
a very different approach on tabs management. Please configure your editor
|
||||||
|
accordingly if you want to share your work.
|
||||||
|
|
||||||
|
If, for and while statement are all written in that way:
|
||||||
|
```shell
|
||||||
|
if [[ condition ]]; then
|
||||||
|
something
|
||||||
|
fi
|
||||||
|
for var in range; do
|
||||||
|
something
|
||||||
|
done
|
||||||
|
while condition; do
|
||||||
|
something
|
||||||
|
done
|
||||||
|
```
|
||||||
|
Case statement will look like this:
|
||||||
|
```shell
|
||||||
|
case var in
|
||||||
|
state1)
|
||||||
|
something
|
||||||
|
;;
|
||||||
|
state2)
|
||||||
|
something
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
something
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
```
|
||||||
|
|
||||||
|
Tests have to be done using if. Writting ```[[ test ]] && action``` is not
|
||||||
|
encouraged even if elegant. It makes reading harder for beginners.
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user