Skip to content

Commit fe72420

Browse files
Merge pull request #11 from rohas-dev/feat/add-cli-banner
feat(cli): add banner display in CLI with version information
2 parents 89db104 + 30e9d2f commit fe72420

22 files changed

Lines changed: 279 additions & 0 deletions

crates/rohas-cli/src/main.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ use std::path::PathBuf;
66
mod commands;
77
mod utils;
88

9+
fn print_banner() {
10+
let version = env!("CARGO_PKG_VERSION");
11+
12+
println!();
13+
println!("╔══════════════════════════════════════════════════════════════╗");
14+
println!("║ ║");
15+
println!("║ ██████╗ ██████╗ ██╗ ██╗ █████╗ ███████╗ ║");
16+
println!("║ ██╔══██╗██╔═══██╗██║ ██║██╔══██╗██╔════╝ ║");
17+
println!("║ ██████╔╝██║ ██║███████║███████║███████╗ ║");
18+
println!("║ ██╔══██╗██║ ██║██╔══██║██╔══██║╚════██║ ║");
19+
println!("║ ██║ ██║╚██████╔╝██║ ██║██║ ██║███████║ ║");
20+
println!("║ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ║");
21+
println!("║ ║");
22+
println!("║ Event-driven workflow orchestration framework ║");
23+
println!("║ Version {} ║", version);
24+
println!("╚══════════════════════════════════════════════════════════════╝");
25+
println!();
26+
}
27+
928
#[derive(Parser)]
1029
#[command(name = "rohas")]
1130
#[command(about = "Rohas - Event-driven workflow orchestration framework", long_about = None)]
@@ -102,6 +121,10 @@ async fn main() -> anyhow::Result<()> {
102121

103122
let cli = Cli::parse();
104123

124+
if !matches!(cli.command, Commands::Version) {
125+
print_banner();
126+
}
127+
105128
match cli.command {
106129
Commands::Init {
107130
name,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from pydantic import BaseModel
2+
from typing import Callable, Awaitable, Dict, Optional
3+
4+
class TimelineTestFastRequest(BaseModel):
5+
query_params: Dict[str, str] = {}
6+
7+
class Config:
8+
from_attributes = True
9+
10+
class TimelineTestFastResponse(BaseModel):
11+
data: str
12+
13+
class Config:
14+
from_attributes = True
15+
16+
TimelineTestFastHandler = Callable[[TimelineTestFastRequest], Awaitable[TimelineTestFastResponse]]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from pydantic import BaseModel
2+
from typing import Callable, Awaitable, Dict, Optional
3+
4+
class TimelineTestMultiStepRequest(BaseModel):
5+
query_params: Dict[str, str] = {}
6+
7+
class Config:
8+
from_attributes = True
9+
10+
class TimelineTestMultiStepResponse(BaseModel):
11+
data: str
12+
13+
class Config:
14+
from_attributes = True
15+
16+
TimelineTestMultiStepHandler = Callable[[TimelineTestMultiStepRequest], Awaitable[TimelineTestMultiStepResponse]]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from pydantic import BaseModel
2+
from typing import Callable, Awaitable, Dict, Optional
3+
4+
class TimelineTestSlowRequest(BaseModel):
5+
query_params: Dict[str, str] = {}
6+
7+
class Config:
8+
from_attributes = True
9+
10+
class TimelineTestSlowResponse(BaseModel):
11+
data: str
12+
13+
class Config:
14+
from_attributes = True
15+
16+
TimelineTestSlowHandler = Callable[[TimelineTestSlowRequest], Awaitable[TimelineTestSlowResponse]]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from pydantic import BaseModel
2+
from typing import Callable, Awaitable, Dict, Optional
3+
4+
class TimelineTestVerySlowRequest(BaseModel):
5+
query_params: Dict[str, str] = {}
6+
7+
class Config:
8+
from_attributes = True
9+
10+
class TimelineTestVerySlowResponse(BaseModel):
11+
data: str
12+
13+
class Config:
14+
from_attributes = True
15+
16+
TimelineTestVerySlowHandler = Callable[[TimelineTestVerySlowRequest], Awaitable[TimelineTestVerySlowResponse]]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from pydantic import BaseModel
2+
from typing import Optional
3+
from datetime import datetime
4+
5+
class TimelineTestFastInput(BaseModel):
6+
test: str
7+
8+
class Config:
9+
from_attributes = True
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from pydantic import BaseModel
2+
from typing import Optional
3+
from datetime import datetime
4+
5+
class TimelineTestMultiStepInput(BaseModel):
6+
test: str
7+
8+
class Config:
9+
from_attributes = True
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from pydantic import BaseModel
2+
from typing import Optional
3+
from datetime import datetime
4+
5+
class TimelineTestSlowInput(BaseModel):
6+
test: str
7+
8+
class Config:
9+
from_attributes = True
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from pydantic import BaseModel
2+
from typing import Optional
3+
from datetime import datetime
4+
5+
class TimelineTestVerySlowInput(BaseModel):
6+
test: str
7+
8+
class Config:
9+
from_attributes = True
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from pydantic import BaseModel
2+
from datetime import datetime
3+
from typing import Callable, Awaitable
4+
5+
class BottleneckDetected(BaseModel):
6+
payload: dict
7+
timestamp: datetime
8+
9+
class Config:
10+
from_attributes = True
11+
12+
BottleneckDetectedHandler = Callable[[BottleneckDetected], Awaitable[None]]

0 commit comments

Comments
 (0)