Skip to content

Commit

Permalink
rename to pl0x
Browse files Browse the repository at this point in the history
  • Loading branch information
rfuzzo committed Feb 28, 2024
1 parent 64004d6 commit cb0717b
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 66 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "cmop"
name = "plox"
description = "PLOX - ??? Load Order eXpert. PLOX is a tool for analyzing and sorting your plugin load order. Supports Morrowind and Cyberpunk"
version = "0.1.0"
edition = "2021"

Expand Down
44 changes: 4 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Cyberpunk Mod Optimizer (CMOP)
# PLOX - ??? Load Order eXpert (PLOX)

> Work in progress
A small rust utility to sort a modlist topologically according to ordering rules, as wall as output warnigns and notes.

## Rules
## Rules

> Rules spec taken from [mlox - the elder scrolls Mod Load Order eXpert](https://github.com/mlox/mlox).
The rules are hosted in their own repository: https://github.com/rfuzzo/cmop-rules
The rules are hosted in their own repository: <https://github.com/rfuzzo/cmop-rules>

**PRs are welcome!**

Expand All @@ -19,59 +19,23 @@ For the rules spec see: [Rules Spec](./docs/Rules_spec.md)
> Subject to change!
```cmd
Usage: cmop.exe [OPTIONS] [COMMAND]
Commands:
list Lists the current mod load order
sort Sorts the current mod load order according to specified rules
verify Verifies integrity of the specified rules
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose Verbose output
-h, --help Print help
-V, --version Print version
```

### list

```cmd
Lists the current mod load order
Usage: cmop.exe list [ROOT]
Arguments:
[ROOT] Root game folder ("Cyberpunk 2077"). Default is current working directory [default: ./]
Options:
-h, --help Print help
```

### sort

```cmd
Sorts the current mod load order according to specified rules
Usage: cmop.exe sort [OPTIONS] [ROOT]
Arguments:
[ROOT] Root game folder ("Cyberpunk 2077"). Default is current working directory [default: ./]
Options:
-r, --rules <RULES> Folder to read sorting rules from. Default is ./cmop [default: ./cmop]
-d, --dry-run Just print the suggested load order without sorting
-m, --mod-list <MOD_LIST> Read the input mods from a file instead of checking the root folder
-h, --help Print help
```

### verify

```cmd
Verifies integrity of the specified rules
Usage: cmop.exe verify [OPTIONS]
Options:
-r, --rules <RULES> Folder to read sorting rules from. Default is ./cmop [default: ./cmop]
-h, --help Print help
```
14 changes: 7 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use clap::{Parser, Subcommand};
use cmop::parser::parse_rules_from_path;
use plox::parser::parse_rules_from_path;
use std::path::PathBuf;
use std::process::ExitCode;

use cmop::*;
use plox::*;

#[derive(Parser)]
#[command(author, version, about, long_about = None)]
Expand All @@ -30,8 +30,8 @@ enum Commands {
#[arg(default_value_t = String::from("./"))]
root: String,

/// Folder to read sorting rules from. Default is ./cmop
#[arg(short, long, default_value_t = String::from("./cmop"))]
/// Folder to read sorting rules from. Default is ./plox
#[arg(short, long, default_value_t = String::from("./plox"))]
rules_dir: String,

/// Just print the suggested load order without sorting
Expand All @@ -44,8 +44,8 @@ enum Commands {
},
/// Verifies integrity of the specified rules
Verify {
/// Folder to read sorting rules from. Default is ./cmop
#[arg(short, long, default_value_t = String::from("./cmop"))]
/// Folder to read sorting rules from. Default is ./plox
#[arg(short, long, default_value_t = String::from("./plox"))]
rules_dir: String,
},
}
Expand All @@ -57,7 +57,7 @@ fn main() -> ExitCode {
Some(Commands::List { root }) => list_mods(&root.into()),
Some(Commands::Verify { rules_dir }) => {
//
let rules_path = PathBuf::from(rules_dir).join("cmop_rules_base.txt");
let rules_path = PathBuf::from(rules_dir).join("plox_rules_base.txt");
verify(&rules_path)
}
Some(Commands::Sort {
Expand Down
6 changes: 3 additions & 3 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(test)]
mod integration_tests {
use cmop::{parser::*, *};
use plox::{parser::*, *};

#[test]
fn test_read_mods() {
Expand All @@ -11,7 +11,7 @@ mod integration_tests {
#[test]
fn test_verify_rules() {
let rules =
parse_rules_from_path("./tests/cmop/rules_order.txt").expect("rule parse failed");
parse_rules_from_path("./tests/plox/rules_order.txt").expect("rule parse failed");
let order = get_order_from_rules(&rules);
let mods = get_mods_from_rules(&order);

Expand All @@ -21,7 +21,7 @@ mod integration_tests {
#[test]
fn test_parse_rules() {
let rules =
parse_rules_from_path("./tests/cmop/rules_note.txt").expect("rule parse failed");
parse_rules_from_path("./tests/plox/rules_note.txt").expect("rule parse failed");
assert_eq!(14, rules.len());
}

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/unit_expression_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(test)]
mod unit_tests {
use cmop::expressions::*;
use plox::expressions::*;

#[test]
fn evaluate_all() {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_parser_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod unit_tests {
use core::panic;
use std::io::Cursor;

use cmop::{expressions::*, parser::*, rules::*};
use plox::{expressions::*, parser::*, rules::*};

#[test]
fn test_tokenize() {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_rules_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(test)]
mod unit_tests {
use cmop::{expressions::*, rules::*};
use plox::{expressions::*, rules::*};

#[test]
fn test_notes() {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[cfg(test)]
mod unit_tests {
use cmop::topo_sort;
use cmop::{expressions::*, rules::*};
use plox::topo_sort;
use plox::{expressions::*, rules::*};

#[test]
fn test_cycle() {
Expand Down

0 comments on commit cb0717b

Please sign in to comment.