Aller au contenu

diractions

https://github.com/AdrieanKhisbe/diractions

Configuration:

Fichier de configuration Diraction:

DIRACTION_DEF_FILE = "~/.diractions"

On peut l'éditer:

$ nano ~/.diractions
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:

$ diraction create <nom> <repertoire>

ou sauver le répertoire courant:

$ diraction save <nom>

Utilisation:

Il suffit de taper le nom de la direction:

~                                   canon

~/Pictures/Raw                       

Sous-commandes:

l | ls

$ 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

$ 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>

$ 74ini ed php.ini

# ouvre /opt/homebrew/etc/php/7.4/php.ini dans $EDITOR

o | open <filename>

$ 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 | ?

$ 74ini w
/opt/homebrew/etc/php/7.4

i | interactive | prompt | shell

$ 74ini i
Entering interactive mode in /opt/homebrew/etc/php/7.4 folder:
\>\>\

e | exec <quoted command>

$ canon e "mv 2021.jpg 2021.png"

c | cd <subdir>

~
$ canon c 2021

~/Pictures/Raw/2021

/ <subdir> | /<subdir>

~
$ 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

Dernière mise à jour: August 31, 2021