index : gmss.git

ascending towards madness

author holly sparkles <sparkles@holly.sh> 2023-12-22 21:43:55.0 +00:00:00
committer holly sparkles <sparkles@holly.sh> 2023-12-22 21:43:55.0 +00:00:00
commit
ee66b2eef821bde3805734b097b018aa6b321512 [patch]
tree
7e981d79822bcb1135006c7390603f57eb32b3f7
parent
8d6e633a59df2df3d0784d8326e1ccd268a65a9e
download
ee66b2eef821bde3805734b097b018aa6b321512.tar.gz

docs: update README and cli args descriptions



Diff

 README.md  | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 src/cli.rs |  6 +++---
 2 files changed, 55 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index de55193..dec9d8c 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@

A screenshot utility written in Rust.

# Usage
## Usage

```shell
gmss -o $HOME/screenshots
@@ -10,10 +10,60 @@ gmss -o $HOME/screenshots
gmss -o $HOME/screenshots --filename-format "epic-screenshot_%Y-%m.png"
```

# Why?
## Why?

I was bored. [Flameshot]https://flameshot.org/ is in my opinion one of the best Linux screenshot utilities. I'm missing a few features, and don't want to bother their developers.

## Filename Timestamps

gmss has support for formatting timestamps in filenames.

The default filename format is
```
screenshot-%Y-%m-%d_%H-%M-%S.png
```

- `%Y`: Year with century as a decimal number (e.g., 2022)
- `%m`: Month as a zero-padded decimal number (01 to 12)
- `%B`: Full month name (e.g., January)
- `%b`: Abbreviated month name (e.g., Jan)
- `%d`: Day of the month as a zero-padded decimal number (01 to 31)
- `%e`: Day of the month as a decimal number (1 to 31)
- `%A`: Full weekday name (e.g., Monday)
- `%a`: Abbreviated weekday name (e.g., Mon)
- `%H`: Hour (00 to 23)
- `%I`: Hour (01 to 12)
- `%M`: Minute (00 to 59)
- `%S`: Second (00 to 59)
- `%p`: AM or PM designation
- `%f`: Subsecond (in nanoseconds)
- `%F`: ISO 8601 date format (YYYY-MM-DD)
- `%c`: Date and time representation appropriate for locale
- `%r`: 12-hour clock time (e.g., 08:30:45 PM)
- `%Z`: Time zone offset (+0900)
- `%z`: Time zone offset (+09:00)
- `%U`: Week number of the year (Sunday as the first day of the week) (00 to 53)
- `%W`: Week number of the year (Monday as the first day of the week) (00 to 53)
- `%j`: Day of the year (001 to 366)
- `%x`: Date representation for the current locale
- `%X`: Time representation for the current locale
- `%%`: Percent sign

# Building

Just the binary:

```rust
cargo build --release
```

The binary *and* the man pages:
```shell
./build.sh
```

The binary will be located at `./target/release/gmss` and the man page is located at `./target/release/gmss.1`

# License

- [AGPL 3.0]LICENSE
diff --git a/src/cli.rs b/src/cli.rs
index ef10bf1..9b48ecc 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -2,10 +2,10 @@ use clap::Parser;

#[derive(Parser, Debug)]
pub struct Args {
    /// The output directory or file to write the file to.
    /// The output directory or file path to write to.
    ///
    /// If a if a directory is specified, a filename will be generated based on
    /// If a directory is specified, a filename will be generated based on
    /// the current date and time.
    #[arg(short, long)]
    #[arg(short, long, value_name = "LOCATION")]
    pub out: String,
}