refactor(cli): improve how we serve the bin to users

This commit is contained in:
Cain 2024-11-26 02:05:36 +00:00
parent 8fab167157
commit 3bcf9385f2
6 changed files with 52 additions and 18 deletions

View file

@ -1,5 +1,5 @@
[package]
name = "gamedig-cli"
name = "gamedig_cli"
authors = [
"rust-GameDig contributors [https://github.com/gamedig/rust-gamedig/contributors]",
]
@ -7,14 +7,13 @@ description = "A command line interface for gamedig"
license = "MIT"
version = "0.1.1"
edition = "2021"
default-run = "gamedig-cli"
default-run = "gamedig_cli"
homepage = "https://gamedig.github.io/"
documentation = "https://docs.rs/gamedig-cli/latest/gamedig-cli/"
repository = "https://github.com/gamedig/rust-gamedig"
readme = "README.md"
keywords = ["server", "query", "game", "check", "status"]
rust-version = "1.65.0"
categories = ["parsing", "command-line-interface"]
rust-version = "1.74.1"
categories = ["command-line-interface"]
[features]
default = ["json", "bson", "xml", "browser"]
@ -34,7 +33,7 @@ browser = ["dep:webbrowser"]
# Core Dependencies
thiserror = "2.0.0"
clap = { version = "4.5.4", default-features = false, features = ["derive"] }
gamedig = { version = "*", path = "../lib", default-features = false, features = [
gamedig = { version = "0.5", default-features = false, features = [
"clap",
"games",
"game_defs",

21
crates/cli/LICENSE.md Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 - 2024 GameDig Organization & Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,20 +1,26 @@
# rust-GameDig CLI
The official [rust-GameDig](https://crates.io/crates/gamedig) Command Line Interface.
The official [rust-GameDig](https://crates.io/crates/gamedig_cli) Command Line Interface.
[![CI](https://github.com/gamedig/rust-gamedig/actions/workflows/ci.yml/badge.svg)](https://github.com/gamedig/rust-gamedig/actions) [![License:MIT](https://img.shields.io/github/license/gamedig/rust-gamedig?color=blue)](https://github.com/gamedig/rust-gamedig/blob/main/LICENSE.md) [![node coverage](https://raw.githubusercontent.com/gamedig/rust-gamedig/main/.github/badges/node.svg)](https://github.com/gamedig/node-gamedig)
## Community
## Installation
Checkout the GameDig Community Discord Server [here](https://discord.gg/NVCMn3tnxH).
Note that it isn't be a replacement for GitHub issues, if you have found a problem
within the library or want to request a feature, it's better to do so here rather than
on Discord.
You can install the CLI via `cargo`:
```sh
cargo install gamedig_cli
```
or
```sh
cargo install gamedig_cli --git https://github.com/gamedig/rust-gamedig.git
```
## Usage
Just by running `gamedig-cli` prints the usage.
**Note**: Passing `--help` (or `-h`) shows the usage.
Running `gamedig_cli` without any arguments will display the usage information. You can also use the `--help` (or `-h`) flag to see detailed usage instructions.
Here's also a quick rundown of a simple query with the `json-pretty` format:
@ -26,8 +32,8 @@ can also be optional if the server is running the default ports) then query on i
[Team Fortress 2](https://store.steampowered.com/app/440/Team_Fortress_2/) query example:
```
gamedig-cli query -g teamfortress2 -i 127.0.0.1 -f json-pretty
```sh
gamedig_cli query -g teamfortress2 -i 127.0.0.1 -f json-pretty
```
What we are doing here:

View file

@ -479,7 +479,7 @@ fn main() -> Result<()> {
Action::License => {
// Bake the license into the binary
// so we don't have to ship it separately
println!("{}", include_str!("../../../LICENSE.md"));
println!("{}", include_str!("../LICENSE.md"));
}
}