Files
mkdocs/docs/Divers/diraction.md
2021-08-31 09:29:05 +02:00

185 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# diractions
https://github.com/AdrieanKhisbe/diractions
#### Configuration:
Fichier de configuration Diraction:
`DIRACTION_DEF_FILE = "~/.diractions"`
On peut l'éditer:
```bash
$ nano ~/.diractions
```
```ini
canon "$HOME/Pictures/Raw"
docs "$HOME/Documents/docs"
74ini /opt/homebrew/etc/php/7.4
80ini /opt/homebrew/etc/php/8.0
apache /opt/homebrew/etc/httpd
```
ou créer ses directions:
```bash
$ diraction create <nom> <repertoire>
```
ou sauver le répertoire courant:
```bash
$ diraction save <nom>
```
#### Utilisation:
Il suffit de taper le nom de la direction:
```bash
~
canon
~/Pictures/Raw
```
#### Sous-commandes:
`l | ls`
```bash
$ 74ini ls
total 84
drwxr-xr-x 12 bruno admin 384 jul 29 18:35 conf.d
-rw-r--r-- 1 bruno admin 1397 jul 28 22:49 pear.conf
-rw-r--r-- 1 bruno admin 5422 jul 28 22:49 php-fpm.conf
drwxr-xr-x 3 bruno admin 96 jul 28 22:49 php-fpm.d
-rw-r--r-- 1 bruno admin 72665 jul 28 22:49 php.ini
```
`t | tree`
```bash
$ 74ini tree
/opt/homebrew/etc/php/7.4
├── conf.d
│   ├── apcu.ini
│   ├── ext-opcache.ini
│   ├── igbinary.ini
│   ├── imagick.ini
│   ├── mcrypt.ini
│   ├── memcached.ini
│   ├── msgpack.ini
│   ├── ssh2.ini
│   ├── xdebug.ini
│   └── yaml.ini
├── pear.conf
├── php-fpm.conf
├── php-fpm.d
│   └── www.conf
└── php.ini
```
`ed | edit <filename>`
```bash
$ 74ini ed php.ini
# ouvre /opt/homebrew/etc/php/7.4/php.ini dans $EDITOR
```
`o | open <filename>`
```bash
$ 74ini o php.ini
# ouvre /opt/homebrew/etc/php/7.4/php.ini dans Nova / bbedit
$ 74ini o
# ouvre le dossier /opt/homebrew/etc/php/7.4/ dans le finder
```
`w | where | ?`
```bash
$ 74ini w
/opt/homebrew/etc/php/7.4
```
`i | interactive | prompt | shell`
```bash
$ 74ini i
Entering interactive mode in /opt/homebrew/etc/php/7.4 folder:
\>\>\
```
`e | exec <quoted command>`
```bash
$ canon e "mv 2021.jpg 2021.png"
```
`c | cd <subdir>`
```bash
~
$ canon c 2021
~/Pictures/Raw/2021
```
`/ <subdir> | /<subdir>`
```bash
~
$ canon / 2021
~/Pictures/Raw/2021
```
#### Commandes globales:
`diraction disable <dirname>`: désactive l'alias
`diraction enable <dirname>`: active l'alias
`diraction destroy <dirname>`: supprime l'alias
`diraction destroy-all`: supprime toutes les directions (requiert l'argument -f ou --force)
`diraction reset`: destroy the diraction and reload them from the configuration
`diraction -h | --help`: aide
#### Préférences:
- DIRACTION_AUTO_CONFIG
- DIRACTION_DEF_FILE
- DIRACTION_EDITOR
- DIRACTION_INTERACTIVE_PROMPT
- DIRACTION_EXPORT_VARIABLES
- DIRACTION_READONLY_VARIABLES