translate to english!
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
# PROMETEU CLI (Dispatcher)
|
||||
|
||||
O binário `prometeu` atua como o front-end unificado para o ecossistema. Ele não implementa a lógica de execução ou compilação, mas sabe onde encontrar os binários que as implementam.
|
||||
The `prometeu` binary acts as the unified front-end for the ecosystem. It does not implement the execution or compilation logic but knows where to find the binaries that do.
|
||||
|
||||
## Comandos
|
||||
## Commands
|
||||
|
||||
- `prometeu run <cart>`: Executa um cartucho usando o runtime disponível.
|
||||
- `prometeu debug <cart> [--port <p>]`: Inicia a execução em modo de depuração.
|
||||
- `prometeu build <projectDir>`: (Planejado) Chama o compilador `prometeuc`.
|
||||
- `prometeu pack <cartDir>`: (Planejado) Chama o empacotador `prometeup`.
|
||||
- `prometeu run <cart>`: Runs a cartridge using the available runtime.
|
||||
- `prometeu debug <cart> [--port <p>]`: Starts execution in debug mode.
|
||||
- `prometeu build <projectDir>`: (Planned) Calls the `prometeuc` compiler.
|
||||
- `prometeu pack <cartDir>`: (Planned) Calls the `prometeup` packager.
|
||||
|
||||
## Funcionamento
|
||||
## How it works
|
||||
|
||||
O dispatcher localiza os binários irmãos (`prometeu-runtime`, `prometeuc`, etc.) no mesmo diretório onde ele próprio está instalado. Ele herda `stdin`, `stdout` e `stderr`, e propaga o código de saída do processo chamado.
|
||||
The dispatcher locates sibling binaries (`prometeu-runtime`, `prometeuc`, etc.) in the same directory where it is installed. It inherits `stdin`, `stdout`, and `stderr`, and propagates the exit code of the called process.
|
||||
|
||||
+21
-21
@@ -5,7 +5,7 @@ use std::process::Command;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "prometeu")]
|
||||
#[command(about = "Dispatcher para o ecossistema Prometeu", long_about = None)]
|
||||
#[command(about = "Dispatcher for the Prometeu ecosystem", long_about = None)]
|
||||
struct Cli {
|
||||
#[command(subcommand)]
|
||||
command: Option<Commands>,
|
||||
@@ -13,30 +13,30 @@ struct Cli {
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum Commands {
|
||||
/// Executa um cartucho
|
||||
/// Executes a cartridge
|
||||
Run {
|
||||
/// Caminho para o cartucho
|
||||
/// Path to the cartridge
|
||||
cart: String,
|
||||
},
|
||||
/// Debuga um cartucho
|
||||
/// Debugs a cartridge
|
||||
Debug {
|
||||
/// Caminho para o cartucho
|
||||
/// Path to the cartridge
|
||||
cart: String,
|
||||
/// Porta para o debugger (padrão: 7777)
|
||||
/// Port for the debugger (default: 7777)
|
||||
#[arg(long, default_value_t = 7777)]
|
||||
port: u16,
|
||||
},
|
||||
/// Compila um projeto
|
||||
/// Builds a project
|
||||
Build {
|
||||
/// Diretório do projeto
|
||||
/// Project directory
|
||||
project_dir: String,
|
||||
},
|
||||
/// Empacota um cartucho
|
||||
/// Packages a cartridge
|
||||
Pack {
|
||||
/// Diretório do cartucho
|
||||
/// Cartridge directory
|
||||
cart_dir: String,
|
||||
},
|
||||
/// Verifica integridade de um projeto ou cartucho
|
||||
/// Verifies the integrity of a project or cartridge
|
||||
Verify {
|
||||
#[command(subcommand)]
|
||||
target: VerifyCommands,
|
||||
@@ -45,14 +45,14 @@ enum Commands {
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum VerifyCommands {
|
||||
/// Verifica um projeto
|
||||
/// Verifies a project
|
||||
C {
|
||||
/// Diretório do projeto
|
||||
/// Project directory
|
||||
project_dir: String,
|
||||
},
|
||||
/// Verifica um cartucho ou arquivo PMC
|
||||
/// Verifies a cartridge or PMC file
|
||||
P {
|
||||
/// Caminho para o cartucho ou PMC
|
||||
/// Path to the cartridge or PMC
|
||||
cart_or_pmc: String,
|
||||
},
|
||||
}
|
||||
@@ -63,7 +63,7 @@ fn main() {
|
||||
let exe_dir = match env::current_exe() {
|
||||
Ok(exe_path) => exe_path.parent().unwrap_or_else(|| Path::new(".")).to_path_buf(),
|
||||
Err(e) => {
|
||||
eprintln!("Erro ao obter o caminho do executável: {}", e);
|
||||
eprintln!("Error obtaining executable path: {}", e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
@@ -109,8 +109,8 @@ fn dispatch(exe_dir: &Path, bin_name: &str, args: &[&str]) {
|
||||
let bin_path = get_binary_path(exe_dir, bin_name);
|
||||
|
||||
if !bin_path.exists() {
|
||||
// Tenta encontrar o runtime com o nome exato (prometeu-runtime-desktop)
|
||||
// caso prometeu-runtime seja apenas um alias ou link que ainda não existe
|
||||
// Tries to find the runtime with the exact name (prometeu-runtime-desktop)
|
||||
// in case prometeu-runtime is just an alias or link that doesn't exist yet
|
||||
let alt_bin_name = if bin_name == "prometeu-runtime" {
|
||||
Some("prometeu-runtime-desktop")
|
||||
} else {
|
||||
@@ -130,7 +130,7 @@ fn dispatch(exe_dir: &Path, bin_name: &str, args: &[&str]) {
|
||||
|
||||
if !final_bin_path.exists() {
|
||||
eprintln!(
|
||||
"prometeu: comando '{}' ainda não está disponível nesta distribuição",
|
||||
"prometeu: command '{}' is not yet available in this distribution",
|
||||
match bin_name {
|
||||
"prometeu-runtime" => "run/debug",
|
||||
"prometeuc" => "build/verify c",
|
||||
@@ -159,7 +159,7 @@ fn execute_bin(bin_path: &Path, args: &[&str]) {
|
||||
std::process::exit(status.code().unwrap_or(0));
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Erro ao executar {}: {}", bin_path.display(), e);
|
||||
eprintln!("Error executing {}: {}", bin_path.display(), e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ fn execute_bin(bin_path: &Path, args: &[&str]) {
|
||||
|
||||
fn not_implemented(cmd: &str, _bin_name: &str) {
|
||||
eprintln!(
|
||||
"prometeu: comando '{}' ainda não está disponível nesta distribuição",
|
||||
"prometeu: command '{}' is not yet available in this distribution",
|
||||
cmd
|
||||
);
|
||||
std::process::exit(1);
|
||||
|
||||
Reference in New Issue
Block a user