Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M shell

> Shell Engine , Building with ***RUST***

tect stack

  • crossterm ( 0.29 ) => untuk menghandle input dan parsing key di terminal
  • toml > untuk management config file
  • dirs => bisa membantu menyesuikan Path windows, dan UNix , seperti config_dir otomatis mendapat :

File && folder

  • main = file atau handle utama
  • command= untuk daftar commnad command yang akan di gunakan build_command.rs : m-shell bisa menjalakan command bawaah OS m_shell_command.rs : custume m-shell commands
  • info = tangani error , error , info ,
  • config : berisis conig config untuk file file dan history config_file.rs : file yg menangani config utama m-shell
    log_file.rs : yang menangani file hasil excecusi , dan di simpan sebagai history

Config file

file config bernama , m-shell.toml yang di simpan di config folder sesui system Operasi yang di gunakan , bisa cek di table ini

OS Lokasi
Linux ~/.config/m-shell/config.toml
macOS ~/Library/Application Support/m-shell/config.toml
Windows C:\Users\user\AppData\Roaming\m-shell\config.toml

Log file

file hasil excecusi, error, dan informasi lainya , bernama m-shell.log di simpan di folder config folder berdasarkan system Operasi yang di gunakan , bisa cek di table ini

OS Lokasi
Linux ~/.config/m-shell/config.toml
macOS ~/Library/Application Support/m-shell/config.toml
Windows C:\Users\user\AppData\Roaming\m-shell\config.toml

Info source code

  • Arc && Mutex : saya guanakna untuk membagi State secara maximal
  • Cow : untuk menangani Inputan error yang aman dan bisa switch antara String atau &str

M Shell Commmand

command bawaan M Shell

format :

m->key1->key2->...

Support perintah berantai ->perintah_lain->perintah_lain

Daftar Command yang bisa di gunakan
  1. update path
  • m->config->path->path_baru : untuk mengupdate path path yang sudah ada di file m-shell.toml
  1. update shell
  • m->config->shell->schema->bentu_baru
Poblem
  1. Command Redirection karena command spesifik m-shell brbentuk -> di sini terdapat tanda Redirection ( > ) yang bisa membuat file baru dari command m-shell ini jika ada command m->ls hasil ls di execusi dan aka di buat file kosong bernama ls ( linux )
    solusi , ada di code ini
// maka kondisi cukup di code ini saja , jangan biarkan merembes ke command di bawahnya yang menjalakna execusi
   if m_shell_commands.cek_command(&command) {
                            // m-shlee command
                            m_shell_commands.execution(&command);
                        } else {

About

shell Engine

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages