Skip to content

Commit

Permalink
refactor: move ark-cli folders inside a crate
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Mar 12, 2024
1 parent 83a57b6 commit 0d22f55
Show file tree
Hide file tree
Showing 20 changed files with 687 additions and 124 deletions.
558 changes: 551 additions & 7 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = [
"ark-cli",
"data-error",
"data-json",
"data-link",
Expand All @@ -12,6 +13,7 @@ members = [
]

default-members = [
"ark-cli",
"data-error",
"data-json",
"data-link",
Expand Down
118 changes: 1 addition & 117 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The purpose of the library is to manage _resource index_ of folders with various

| Package | Description |
| --------------- | ---------------------------------------- |
| `ark-cli` | The CLI tool to interact with ark crates |
| `data-resource` | Resource hashing and ID construction |
| `fs-index` | Resource Index construction and updating |
| `fs-storage` | Filesystem storage for resources |
Expand Down Expand Up @@ -67,120 +68,3 @@ Our benchmark suite includes tests on local files and directories. These benchma
You have the flexibility to benchmark specific files or folders by modifying the variables within the benchmark files. By default, the benchmarks operate on the [`test-assets/`](test-assets/) directory and its contents. You can change the directory/files by setting the `DIR_PATH` and `FILE_PATHS` variables to the desired values.

For pre-benchmark assessment of required time to index a huge local folder, you can modify `test_build_resource_index` test case in `src/index.rs`.

# Ark-CLI

### Installation

To compile you will need openssl libraries and headers:

```shell
# macOS (Homebrew)
$ brew install openssl@3

# macOS (MacPorts)
$ sudo port install openssl

# macOS (pkgsrc)
$ sudo pkgin install openssl

# Arch Linux
$ sudo pacman -S pkg-config openssl

# Debian and Ubuntu
$ sudo apt-get install pkg-config libssl-dev

# Fedora
$ sudo dnf install pkg-config perl-FindBin openssl-devel

# Alpine Linux
$ apk add pkgconfig openssl-dev
```

### Usage

```shell
ark-cli <SUBCOMMAND>

OPTIONS:
-h, --help Print help information

SUBCOMMANDS:
backup
collisions
help Print this message or the help of the given subcommand(s)
link
monitor
render

```

#### Backup

```shell
USAGE:
ark-cli backup [ROOTS_CFG]

ARGS:
<ROOTS_CFG>

OPTIONS:
-h, --help Print help information
```

#### Collisions

```shell
USAGE:
ark-cli collisions [ROOT_DIR]

ARGS:
<ROOT_DIR>

OPTIONS:
-h, --help Print help information
```

#### Link

```shell
USAGE:
ark-cli link <SUBCOMMAND>

OPTIONS:
-h, --help Print help information

SUBCOMMANDS:
create
help Print this message or the help of the given subcommand(s)
load
```

#### Monitor

```shell
USAGE:
ark-cli monitor [ARGS]

ARGS:
<ROOT_DIR>
<INTERVAL>

OPTIONS:
-h, --help Print help information
```

#### Render

```shell
USAGE:
ark-cli render [ARGS]

ARGS:
<PATH>
<QUALITY>

OPTIONS:
-h, --help Print help information

```
22 changes: 22 additions & 0 deletions ark-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "ark-cli"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "ark-cli"

[dependencies]
tokio = { version = "1.35.1", features = ["full"] }
arklib = { git = "https://github.com/ARK-Builders/arklib", rev = "2c7ceda" }
clap = { version = "3.0.10", features = ["derive"] }
env_logger = "0.9.0"
fs_extra = "1.2.0"
walkdir = "2.3.2"
home = "0.5.3"
url = { version = "2.2.2", features = ["serde"] }
serde_json = "1.0.82"
serde = { version = "1.0.138", features = ["derive"] }
chrono = "0.4.34"
anyhow = "1.0.80"
thiserror = "1.0.57"
111 changes: 111 additions & 0 deletions ark-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Ark-CLI

### Installation

To compile you will need openssl libraries and headers:

```shell
# macOS (Homebrew)
$ brew install openssl@3

# macOS (MacPorts)
$ sudo port install openssl

# macOS (pkgsrc)
$ sudo pkgin install openssl

# Arch Linux
$ sudo pacman -S pkg-config openssl

# Debian and Ubuntu
$ sudo apt-get install pkg-config libssl-dev

# Fedora
$ sudo dnf install pkg-config perl-FindBin openssl-devel

# Alpine Linux
$ apk add pkgconfig openssl-dev
```

### Usage

```shell
ark-cli <SUBCOMMAND>

OPTIONS:
-h, --help Print help information

SUBCOMMANDS:
backup
collisions
help Print this message or the help of the given subcommand(s)
link
monitor
render

```

#### Backup
```shell
USAGE:
ark-cli backup [ROOTS_CFG]

ARGS:
<ROOTS_CFG>

OPTIONS:
-h, --help Print help information
```

#### Collisions
```shell
USAGE:
ark-cli collisions [ROOT_DIR]

ARGS:
<ROOT_DIR>

OPTIONS:
-h, --help Print help information
```

#### Link
```shell
USAGE:
ark-cli link <SUBCOMMAND>

OPTIONS:
-h, --help Print help information

SUBCOMMANDS:
create
help Print this message or the help of the given subcommand(s)
load
```

#### Monitor
```shell
USAGE:
ark-cli monitor [ARGS]

ARGS:
<ROOT_DIR>
<INTERVAL>

OPTIONS:
-h, --help Print help information
```

#### Render
```shell
USAGE:
ark-cli render [ARGS]

ARGS:
<PATH>
<QUALITY>

OPTIONS:
-h, --help Print help information

```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0d22f55

Please sign in to comment.