Compare commits

..

No commits in common. "37b3fc8b4fdf1e4225c31c41f7205108f5f4bf6f" and "f5c88077f8b96cbbdccceb0c13179d6a87f45b71" have entirely different histories.

5 changed files with 14 additions and 90 deletions

4
.gitignore vendored
View File

@ -18,7 +18,6 @@
userdata/ userdata/
trinitrix.log trinitrix.log
plugin.txt
# build # build
/target /target
@ -30,9 +29,6 @@ plugin.txt
.idea .idea
.direnv .direnv
# Pre Commit hooks
.pre-commit-config.yaml
# LS # LS
## lua ## lua
.luarc.json .luarc.json

View File

@ -56,58 +56,6 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks": {
"inputs": {
"flake-compat": [
"flake-compat"
],
"flake-utils": [
"flake-utils"
],
"gitignore": [
"gitignore"
],
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1714478972,
"narHash": "sha256-q//cgb52vv81uOuwz1LaXElp3XAe1TqrABXODAEF6Sk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "2849da033884f54822af194400f8dff435ada242",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1714656196, "lastModified": 1714656196,
@ -129,8 +77,6 @@
"crane": "crane", "crane": "crane",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"git-hooks": "git-hooks",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",
"systems": "systems", "systems": "systems",

View File

@ -34,16 +34,6 @@
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
}; };
}; };
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs = {
flake-compat.follows = "flake-compat";
flake-utils.follows = "flake-utils";
gitignore.follows = "gitignore";
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs";
};
};
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs = { inputs = {
@ -53,12 +43,6 @@
}; };
# inputs for following # inputs for following
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
systems = { systems = {
url = "github:nix-systems/x86_64-linux"; # only evaluate for this system url = "github:nix-systems/x86_64-linux"; # only evaluate for this system
}; };
@ -78,7 +62,6 @@
self, self,
nixpkgs, nixpkgs,
flake-utils, flake-utils,
git-hooks,
treefmt-nix, treefmt-nix,
crane, crane,
rust-overlay, rust-overlay,
@ -158,19 +141,11 @@
checks = { checks = {
inherit craneBuild; inherit craneBuild;
formatting = treefmtEval.config.build.check self; formatting = treefmtEval.config.build.check self;
pre-commit = git-hooks.lib.${system}.run {
src = ./.;
hooks.treefmt = {
enable = true;
package = treefmtEval.config.build.wrapper;
};
};
}; };
formatter = treefmtEval.config.build.wrapper; formatter = treefmtEval.config.build.wrapper;
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
inherit (self.checks.${system}.pre-commit) shellHook;
packages = with pkgs; [ packages = with pkgs; [
cocogitto cocogitto

View File

@ -24,11 +24,11 @@ use clap::{Parser, Subcommand};
/// A multi protocol chat client /// A multi protocol chat client
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
#[command(author, version, about, long_about = None, arg_required_else_help(true))] #[command(author, version, about, long_about = None)]
pub struct Args { pub struct Args {
#[command(subcommand)] #[command(subcommand)]
/// The subcommand to execute, default is help /// The subcommand to execute, default is start
pub subcommand: Command, pub subcommand: Option<Command>,
// #[arg(long, short)] // #[arg(long, short)]
// /// Path to the Lua config file, executed instead of the normal one // /// Path to the Lua config file, executed instead of the normal one
@ -39,8 +39,8 @@ pub struct Args {
} }
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
pub enum Command { pub enum Command {
/// Starts a TUI client /// Starts the main TUI client
Tui {}, Start {},
/// Starts a repl to the trinitry cli interpreter /// Starts a repl to the trinitry cli interpreter
Repl {}, Repl {},

View File

@ -35,8 +35,15 @@ async fn main() -> anyhow::Result<()> {
cli_log::init_cli_log!(); cli_log::init_cli_log!();
let args = Args::parse(); let args = Args::parse();
match args.subcommand { let command = args.subcommand.unwrap_or(Command::Start {});
Command::Tui {} => {} match command {
Command::Start {} => {
todo!("The full ui is not yet finished");
let mut app = app::App::new(Repl::new()?)?;
// NOTE(@soispha): The `None` here is temporary <2024-05-03>
app.run(None, args.plugin_path).await?;
}
Command::Repl {} => { Command::Repl {} => {
let mut app = app::App::new(Repl::new().context("Failed to setup repl")?)?; let mut app = app::App::new(Repl::new().context("Failed to setup repl")?)?;