remove extra format argument

This commit is contained in:
yggverse 2025-06-10 01:53:05 +03:00
parent 599435f1ab
commit 1f349cd7c7
3 changed files with 1 additions and 23 deletions

View file

@ -4,16 +4,11 @@
[![Dependencies](https://deps.rs/repo/github/YGGverse/htcount/status.svg)](https://deps.rs/repo/github/YGGverse/htcount) [![Dependencies](https://deps.rs/repo/github/YGGverse/htcount/status.svg)](https://deps.rs/repo/github/YGGverse/htcount)
[![crates.io](https://img.shields.io/crates/v/htcount.svg)](https://crates.io/crates/htcount) [![crates.io](https://img.shields.io/crates/v/htcount.svg)](https://crates.io/crates/htcount)
Simple CLI/daemon tool for counting visitors using `access.log`\ Simple CLI/daemon tool for counting visitors using `access.log` in the [Common Log Format](https://en.wikipedia.org/wiki/Common_Log_Format)\
Export totals in multiple formats, such as JSON or SVG [badge](https://github.com/YGGverse/htcount/tree/main/default)! Export totals in multiple formats, such as JSON or SVG [badge](https://github.com/YGGverse/htcount/tree/main/default)!
## Features ## Features
### Log format support
* [x] Nginx
* [ ] Apache
### Export formats ### Export formats
* [x] JSON - for API usage * [x] JSON - for API usage
@ -44,13 +39,6 @@ htcount --source /var/log/nginx/access.log\
[default: i] [default: i]
-f, --format <FORMAT>
Log format for given `source`
* `nginx`
[default: nginx]
--target-json <TARGET_JSON> --target-json <TARGET_JSON>
Export results to JSON file (e.g. `/path/to/stats.json`) Export results to JSON file (e.g. `/path/to/stats.json`)

View file

@ -10,12 +10,6 @@ pub struct Argument {
#[arg(short, long, default_value_t = String::from("i"))] #[arg(short, long, default_value_t = String::from("i"))]
pub debug: String, pub debug: String,
/// Log format for given `source`
///
/// * `nginx`
#[arg(short, long, default_value_t = String::from("nginx"))]
pub format: String,
/// Export results to JSON file (e.g. `/path/to/stats.json`) /// Export results to JSON file (e.g. `/path/to/stats.json`)
#[arg(long)] #[arg(long)]
pub target_json: Option<String>, pub target_json: Option<String>,

View file

@ -19,10 +19,6 @@ fn main() -> anyhow::Result<()> {
let is_debug_i = argument.debug.contains("i"); let is_debug_i = argument.debug.contains("i");
let is_debug_d = argument.debug.contains("d"); let is_debug_d = argument.debug.contains("d");
if !matches!(argument.format.to_lowercase().as_str(), "nginx") {
todo!("Format `{}` yet not supported!", argument.format)
}
if is_debug_i { if is_debug_i {
debug::info("Crawler started"); debug::info("Crawler started");
} }