doc:s: add documentation and complete the readme
All checks were successful
build and upload / build (push) Successful in 16s

This commit is contained in:
2025-05-03 01:30:35 +02:00
parent eafee7e164
commit 3bca4ef8bd
9 changed files with 249 additions and 7 deletions

View File

@@ -25,6 +25,4 @@ jobs:
uses: christopherhx/gitea-upload-artifact@v4
with:
name: feddy
path: |
target/release/feddy
completions.*
path: target/release/feddy

10
Cargo.lock generated
View File

@@ -89,6 +89,15 @@ dependencies = [
"clap_derive",
]
[[package]]
name = "clap-markdown"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2a2617956a06d4885b490697b5307ebb09fec10b088afc18c81762d848c2339"
dependencies = [
"clap",
]
[[package]]
name = "clap_builder"
version = "4.5.37"
@@ -197,6 +206,7 @@ name = "feddy"
version = "0.1.0"
dependencies = [
"clap",
"clap-markdown",
"clap_complete",
"env_logger",
"log",

View File

@@ -8,6 +8,7 @@ description = "Your awesome, friendly, lightning-fast, and super-easy-to-use Fed
[dependencies]
clap = { version = "4.5", features = ["derive", "env", "cargo"] }
clap_complete = "4.5"
clap-markdown = "0.1"
log = "0.4"
env_logger = "0.11"
rust-ini = "0.21"

186
DOCUMENTATION.md Normal file
View File

@@ -0,0 +1,186 @@
# Command-Line Help for `feddy`
This document contains the help content for the `feddy` command-line program.
**Command Overview:**
* [`feddy`↴](#feddy)
* [`feddy configure-dnf`↴](#feddy-configure-dnf)
* [`feddy add-repo`↴](#feddy-add-repo)
* [`feddy add-repo vscode`↴](#feddy-add-repo-vscode)
* [`feddy add-repo mullvad`↴](#feddy-add-repo-mullvad)
* [`feddy add-repo vivaldi`↴](#feddy-add-repo-vivaldi)
* [`feddy install-rpm-fusion`↴](#feddy-install-rpm-fusion)
* [`feddy configure-groups`↴](#feddy-configure-groups)
* [`feddy package`↴](#feddy-package)
* [`feddy package common-list`↴](#feddy-package-common-list)
* [`feddy package amd-list`↴](#feddy-package-amd-list)
* [`feddy package intel-list`↴](#feddy-package-intel-list)
* [`feddy package gnome-extra-list`↴](#feddy-package-gnome-extra-list)
* [`feddy package firmware-list`↴](#feddy-package-firmware-list)
* [`feddy package custom-list`↴](#feddy-package-custom-list)
## `feddy`
Your awesome, friendly, lightning-fast, and super-easy-to-use Fedora Buddy !
**Usage:** `feddy [COMMAND]`
###### **Subcommands:**
* `configure-dnf` — Configure dnf
* `add-repo` — Add a repository
* `install-rpm-fusion` — Install RPM fusion
* `configure-groups` — Add groups to a user
* `package` — Manage packages
## `feddy configure-dnf`
Configure dnf
**Usage:** `feddy configure-dnf`
## `feddy add-repo`
Add a repository
**Usage:** `feddy add-repo <COMMAND>`
###### **Subcommands:**
* `vscode` — Add VSCode repository
* `mullvad` — Add Mullvad repository
* `vivaldi` — Add Vivaldi repository
## `feddy add-repo vscode`
Add VSCode repository
**Usage:** `feddy add-repo vscode`
## `feddy add-repo mullvad`
Add Mullvad repository
**Usage:** `feddy add-repo mullvad`
## `feddy add-repo vivaldi`
Add Vivaldi repository
**Usage:** `feddy add-repo vivaldi`
## `feddy install-rpm-fusion`
Install RPM fusion
**Usage:** `feddy install-rpm-fusion`
## `feddy configure-groups`
Add groups to a user
**Usage:** `feddy configure-groups [OPTIONS]`
###### **Options:**
* `-u`, `--user <USER>` — The user to add to the groups, current user by default
* `-p`, `--print` — Print the groups without changing anything
## `feddy package`
Manage packages
**Usage:** `feddy package [OPTIONS] <COMMAND>`
###### **Subcommands:**
* `common-list` — Install/Remove the common list
* `amd-list` — Install/Remove the AMD list
* `intel-list` — Install/Remove the Intel list
* `gnome-extra-list` — Install/Remove the Gnome extra list
* `firmware-list` — Install/Remove the firmware list
* `custom-list` — Install/Remove a custom list
###### **Options:**
* `-r`, `--remove` — Whenever to remove instead of install
* `-p`, `--print` — Print packages of the list without changing anything
## `feddy package common-list`
Install/Remove the common list
**Usage:** `feddy package common-list`
## `feddy package amd-list`
Install/Remove the AMD list
**Usage:** `feddy package amd-list`
## `feddy package intel-list`
Install/Remove the Intel list
**Usage:** `feddy package intel-list`
## `feddy package gnome-extra-list`
Install/Remove the Gnome extra list
**Usage:** `feddy package gnome-extra-list`
## `feddy package firmware-list`
Install/Remove the firmware list
**Usage:** `feddy package firmware-list`
## `feddy package custom-list`
Install/Remove a custom list
**Usage:** `feddy package custom-list --file <FILE>`
###### **Options:**
* `-f`, `--file <FILE>` — The file to read the list from
<hr/>
<small><i>
This document was generated automatically by
<a href="https://crates.io/crates/clap-markdown"><code>clap-markdown</code></a>.
</i></small>

View File

@@ -13,6 +13,7 @@ INSTALL_DATA ?= $(INSTALL) -m 644
build:
cargo build --release
target/release/$(PROJECT) --doc > DOCUMENTATION.md
format:
cargo fmt --all

View File

@@ -1,3 +1,38 @@
# feddy
Your awesome, friendly, lightning-fast, and super-easy-to-use Fedora Buddy !
## Usage
This project is a command line tool that helps you to manage your Fedora system. You can use it to install or remove package lists, as well as to perform other post installation tasks.
Please refer to the [DOCUMENTATION.md](DOCUMENTATION.md) file for more information on how to use the tool.
## Install on Fedora
Please refer to project's [releases](https://git.rawleenc.dev/rawleenc/feddy/releases), copy the RPM package link of the latest version and install it with dnf.
## Build from source
This is a Rust project, so you must first install [Rust](https://www.rust-lang.org/tools/install) and then run the following command to build the project:
```bash
./configure
make
```
## Install from source
You can install the project by running the following command:
```bash
sudo make install
```
## Development
You can run the project in development mode by running the following command:
```bash
cargo run -- ${args}
```

View File

@@ -25,6 +25,7 @@ Your awesome, friendly, lightning-fast, and super-easy-to-use Fedora Buddy !
%files
%license LICENSE
%doc DOCUMENTATION.md
%doc README.md
%{_bindir}/feddy

View File

@@ -11,8 +11,11 @@ pub type Result<T> = core::result::Result<T, Box<dyn Error>>;
#[derive(Parser, Debug, PartialEq)]
#[command(name = crate_name!(), author = crate_authors!(), version = crate_version!(), about = crate_description!())]
pub struct Cli {
#[arg(long = "generate", hide = true, value_enum)]
pub generator: Option<Shell>,
#[arg(long, hide = true, value_enum)]
pub completion: Option<Shell>,
#[arg(long, hide = true)]
pub doc: bool,
#[command(subcommand)]
pub command: Option<Commands>,

View File

@@ -8,9 +8,16 @@ fn main() {
configure_logger();
let cli = Cli::parse();
if cli.doc {
log::info!("Generating markdown documentation...");
clap_markdown::print_help_markdown::<Cli>();
return;
}
let mut cmd = Cli::command();
if let Some(generator) = cli.generator {
if let Some(generator) = cli.completion {
log::info!("Generating completion file for {generator:?}...");
print_completions(generator, &mut cmd);
return;