Update README and help menu
This commit is contained in:
47
README.md
47
README.md
@@ -1,51 +1,60 @@
|
|||||||
# tuemensa
|
# tuemensa
|
||||||
|
|
||||||
tuemensa is a simple cli tool to retrieve the current meal plan.
|
`tuemensa` is a simple command-line tool designed to retrieve the current meal plan for the canteens at Eberhard Karls Universität Tübingen.
|
||||||
|
The meal data is sourced from [Studierendenwerk Tübingen - Hohenheim](https://www.my-stuwe.de/mensa/).
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
To install the tool directly from [crates.io](https://crates.io/crates/tuemensa), use the command:
|
||||||
|
```sh
|
||||||
|
cargo install tuemensa
|
||||||
|
```
|
||||||
|
Alternatively, you can clone this repository and run the following command from the project root to build it:
|
||||||
|
```sh
|
||||||
|
cargo build -r
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Options:
|
Available options:
|
||||||
|
|
||||||
- `-m`, `--morgenstelle` Show Mensa Morgenstelle
|
- `-m`, `--morgenstelle` Display the meal plan for Mensa Morgenstelle
|
||||||
- `-w`, `--wilhemstrasse` Show Mensa Wilhelmstraße
|
- `-w`, `--wilhemstrasse` Display the meal plan for Mensa Wilhelmstraße
|
||||||
- `-p`, `--prinzkarl` Show Mensa Prinz Karl
|
- `-p`, `--prinzkarl` Display the meal plan for Mensa Prinz Karl
|
||||||
- `--plaintext` Format as plain text
|
- `--plaintext` Output the meal plan in plain text format
|
||||||
- `-o`, `--oneline` Use very short format (oneline)
|
- `-o`, `--oneline` Use very short format (oneline)
|
||||||
- `-d`, `--days <DAYS>` Offset of days in the future (valid inputs 0-7) [default: 0]
|
- `-d`, `--days <DAYS>` Specify the number of days ahead to display (valid inputs 0-7) [default: 0]
|
||||||
- `-v`, `--vegetarian` Show the vegetarian menu
|
- `-v`, `--vegetarian` Display only the vegetarian menu options
|
||||||
- `-h`, `--help` Print help information
|
- `-h`, `--help` Print help information
|
||||||
- `-V`, `--version` Print version information
|
- `-V`, `--version` Print version information
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
Display the current plan for both canteens:
|
To display the current meal plan for both Mensa Morgenstelle and Wilhelmstraße:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
tuemensa -s -m
|
tuemensa -w -m
|
||||||
```
|
```
|
||||||
Example screenshot:
|
Example screenshot:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Display the plan for the next day:
|
To view the meal plan for the following day:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
tuemensa -s -d 1
|
tuemensa -w -d 1
|
||||||
```
|
```
|
||||||
|
|
||||||
The oneline is useful if you integrate this tool as a desktop widget
|
For a compact view, which is useful for integration into desktop widgets, you can use the oneline option:
|
||||||
and like to get just a basic idea of the current available meal.
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
tuemensa -s -o
|
tuemensa -w -o
|
||||||
```
|
```
|
||||||
|
|
||||||
Example screenshot:
|
Example screenshot:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
For KDE this can be achieved with the Plasma 5 Applet [Command Output](https://store.kde.org/p/1166510/).
|
For KDE users, this functionality can be achieved with the Plasma 5 Applet [Command Output](https://store.kde.org/p/1166510/).
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
Use the `cargo build -r` command inside the root of this project.
|
|
||||||
|
14
src/cli.rs
14
src/cli.rs
@@ -1,22 +1,22 @@
|
|||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
/// tuemensa is a simple cli tool to retrieve the current meal plan.
|
///tuemensa is a simple command-line tool designed to retrieve the current meal plans for the canteens at Eberhard Karls Universität Tübingen.
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[command(author, version, about, long_about = None)]
|
#[command(author, version, about, long_about = None)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
/// Show Mensa Morgenstelle
|
/// Display the meal plan for Mensa Morgenstelle
|
||||||
#[arg(short, long, default_value_t = false)]
|
#[arg(short, long, default_value_t = false)]
|
||||||
pub morgenstelle: bool,
|
pub morgenstelle: bool,
|
||||||
|
|
||||||
/// Show Mensa Wilhelmstraße
|
/// Display the meal plan for Mensa Wilhelmstraße
|
||||||
#[arg(short, long, default_value_t = false)]
|
#[arg(short, long, default_value_t = false)]
|
||||||
pub wilhelmstrasse: bool,
|
pub wilhelmstrasse: bool,
|
||||||
|
|
||||||
/// Show Mensa Prinz Karl
|
/// Display the meal plan for Mensa Prinz Karl
|
||||||
#[arg(short, long, default_value_t = false)]
|
#[arg(short, long, default_value_t = false)]
|
||||||
pub prinzkarl: bool,
|
pub prinzkarl: bool,
|
||||||
|
|
||||||
/// Format as plain text
|
/// Output the meal plan in plain text format
|
||||||
#[arg(long, default_value_t = false)]
|
#[arg(long, default_value_t = false)]
|
||||||
pub plaintext: bool,
|
pub plaintext: bool,
|
||||||
|
|
||||||
@@ -24,11 +24,11 @@ pub struct Args {
|
|||||||
#[arg(short, long, default_value_t = false)]
|
#[arg(short, long, default_value_t = false)]
|
||||||
pub oneline: bool,
|
pub oneline: bool,
|
||||||
|
|
||||||
/// Offset of days in the future (valid inputs 0-7)
|
/// Specify the number of days ahead to display (valid values: 0-7)
|
||||||
#[arg(short, long, default_value_t = 0)]
|
#[arg(short, long, default_value_t = 0)]
|
||||||
pub days: u8,
|
pub days: u8,
|
||||||
|
|
||||||
/// Show the vegetarian menu
|
/// Display only the vegetarian meal options
|
||||||
#[arg(short, long, default_value_t = false)]
|
#[arg(short, long, default_value_t = false)]
|
||||||
pub vegetarian: bool,
|
pub vegetarian: bool,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user