Skip to content

Commit

Permalink
docs: update the readme & comments
Browse files Browse the repository at this point in the history
  • Loading branch information
talwat committed Aug 9, 2024
1 parent 0f8cd06 commit fc428fd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,45 @@ A better rust version of pokeget.

for more info, run `pokeget --help`

Also, if you're using pokeget in your bashrc, then instead of running `pokeget <pokemon>`,
Also, if you're using pokeget in your `.bashrc`, then instead of running `pokeget <pokemon>`,
you can just write the output to a file by doing: `pokeget <pokemon> > file.txt` and then
have something like `cat file.txt` bashrc.

You can also use multiple pokemon like:
You can also use multiple pokemon with names:

`pokeget bulbasaur pikachu`
`pokeget bulbasaur pikachu random`

and dex id's work too:
Or pokedex ID's:

`pokeget 1 2 3`

## Installation

If you're on arch, you can use the AUR:
### Cargo *(recommended)*

The recommended installation method is to use cargo:

```sh
yay -S pokeget
cargo install pokeget
```

You can either use cargo by doing:
and making sure `$HOME/.cargo/bin` is added to `$PATH`.

### AUR

If you're on Arch, you can also use the AUR:

```sh
cargo install pokeget
yay -S pokeget
```

and making sure `$HOME/.cargo/bin` is added to `$PATH`.
> [!WARNING]
> The AUR repository is currently unmaintained.
> If you'd like to maintain it, [open an issue](https://github.com/talwat/pokeget-rs/issues).
or clone the repository and compiling manually by doing:
### Git

You can also clone the repository and compile manually by doing:

```sh
git clone --recurse-submodules https://github.com/talwat/pokeget-rs.git
Expand Down Expand Up @@ -86,11 +96,6 @@ It also is significantly (5.5x) faster than krabby which is another very similar

For more info, go to [OTHER_PROJECTS.md](OTHER_PROJECTS.md).

## Where are the prebuilt binaries?

I cannot figure out how to compile rust to multiple different platforms with a CI pipeline like github actions.
If someone knows how, PLEASE make a PR.

## What about big sprites?

Gone. Reduced to atoms.
Expand Down
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ pub struct Args {
#[arg(long, default_value_t = false)]
pub hisui: bool,

/// Display the noble variant of the pokemon, this option often times only works in tandom with --hisui.
/// Display the noble variant of the pokemon, this option often times only works in tandom with --hisui
#[arg(short, long, default_value_t = false)]
pub noble: bool,

/// Display the galarian variant of the pokemon
#[arg(long, default_value_t = false)]
pub galar: bool,

/// Display the female variant of the pokemon if it exists. This doesn't apply to nidoran, for some reason.
/// Display the female variant of the pokemon if it exists. This doesn't apply to nidoran, for some reason
#[arg(long, default_value_t = false)]
pub female: bool,
}
7 changes: 5 additions & 2 deletions src/pokemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ use rand::Rng;
use crate::{cli::Args, Data};

/// Returns a random pokemon.
pub fn random(list: &[&str]) -> String {
fn random(list: &[&str]) -> String {
let mut rand = rand::thread_rng();

String::from(list[rand.gen_range(0..list.len())])
}

/// Formats the pokemon name for display.
fn format_name(name: String) -> String {
name.replace('-', " ").replace('\'', "").to_title_case()
}
Expand All @@ -31,8 +32,10 @@ impl Selection {
// If it's zero, then change it to random.
0 => Selection::Random,

//
// If it's not zero and in the range of the list, then it's a dex id.
id if (id > 0 && id <= list.len()) => Selection::DexId(id - 1),

// This shouldn't normally fire, but it's here to give the proper error message.
_ => Selection::Name(id),
};
} else {
Expand Down

0 comments on commit fc428fd

Please sign in to comment.