Skip to content

Commit

Permalink
docs: fix mistakes, and elaborate in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
talwat committed Sep 8, 2024
1 parent ea4921d commit c7d5b5e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 20 deletions.
9 changes: 6 additions & 3 deletions OTHER_PROJECTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Please note some of these might not be maintained.

## [pokemon-colorscripts](https://gitlab.com/phoneybadger/pokemon-colorscripts/)

It's changed quite a bit since I last looked at it.
It's now written in python, and many of my previous issues with it have been fixed.
It's changed quite a bit since I last looked at it,
as it is now written in python, and many of my previous issues with it have been fixed.

It actually uses the same sprite database that pokeget does, which is quite cool.
It still requires the actual sprite files be on your machine, so it isn't very portable.
However, it also requires the actual sprite files be on your machine, so it isn't very portable.

## [pokeshell](https://github.com/acxz/pokeshell)

Expand All @@ -19,5 +19,8 @@ Other than that, it's still extremely feature rich with animations and a lot of
## [krabby](https://github.com/yannjor/krabby)

Krabby is also written in rust, but it isn't very fast and can't display multiple sprites at once.
The slowness is because it uses a full JSON API to retrieve forms and pokemon data, while pokeget
settles with simpler guesses and compromises. As a result, pokeget is much faster than Krabby by a
factor of about ~5x on an M1 Macbook.

Although it has a random shiny option, which in my opinion is absolutely awesome.
53 changes: 38 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,33 @@ A better rust version of pokeget.

`pokeget <pokemon>`

for more info, run `pokeget --help`
For more info, run `pokeget --help`.

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.
### .bashrc

You can also use multiple pokemon with names:
If you're using pokeget on shell startup, such as in `.bashrc`,
then instead of running `pokeget <pokemon>`, you can write the output
to a file by doing: `pokeget <pokemon> > file.txt`
and then have something like `cat file.txt` in your bashrc.

This makes your shell initialization practically instant, but obviously
won't work with random pokemon. pokeget is already fairly fast,
so using it on shell initialization is also not a very large bottleneck.

### Examples

#### Using multiple pokemon

`pokeget bulbasaur pikachu random`

Or pokedex ID's:
#### Using pokedex ID's

`pokeget 1 2 3`

#### Using alternative forms

`pokeget raichu sandslash meowth --alolan`

## Installation

### Cargo *(recommended)*
Expand Down Expand Up @@ -57,10 +70,6 @@ mv target/release/pokeget ~/.local/bin

and making sure `$HOME/.local/bin` is added to `$PATH`.

## Updating

Just rerun `cargo install pokeget` or `git pull` on the repository and then recompile.

### Adding a directory to $PATH

#### Bash & Zsh
Expand All @@ -79,12 +88,17 @@ Run this in your CLI:
fish_add_path <path>
```

## Updating

Just rerun `cargo install pokeget` or `git pull` on the repository and then recompile.

## Why?

Because the first pokeget was slow, bloated, and super complicated I decided to make a better version in rust.
Because the first pokeget was slow, bloated, and super complicated, so I decided to make a better version in rust.

Now, instead of precomputing all the sprites and uploading them to a repo, pokeget will
be able to compute them on the fly which makes everything much more flexible while still retaining performance.
be able to compute them on-demand which makes everything much more flexible.
Rust enables that computation to be done much more quickly than something like python.

It will also draw the sprites 2x smaller by using half squares.

Expand All @@ -100,10 +114,19 @@ For more info, go to [OTHER_PROJECTS.md](OTHER_PROJECTS.md).

Gone. Reduced to atoms.

In all seriousness, i've just decided to not deal with them since it's extra work that I don't want to deal with.
In all seriousness, I've just decided to not deal with them since it's significantly
extra work that I don't want to deal with. They were rarely used, and looked ugly
in small terminal windows, so there was little use in keeping them.

## Credits

This time, the sprites are from [pokesprite](https://github.com/msikma/pokesprite) and pokeget uses them with a submodule.
This time, the sprites are from [pokesprite](https://github.com/msikma/pokesprite) and pokeget uses them with a git submodule.

Sprites are embedded into the binary, so pokeget won't download them. This is a good compromise,
since while the binary may be large, pokeget can execute almost instantly and while offline.

## License

Sprites are embedded into the binary, so pokeget won't download them.
pokeget uses the MIT license, so feel free to fork it and customize it as you please.
If you're unsure about any of the internal workings of pokeget, [open an issue](https://github.com/talwat/pokeget-rs/issues),
and I'll answer whatever question you might have.
4 changes: 2 additions & 2 deletions src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ pub struct List {
names: Vec<String>,
}

impl<'a> Index<usize> for List {
impl Index<usize> for List {
type Output = String;

fn index(&self, index: usize) -> &Self::Output {
self.ids.get_by_left(&index).unwrap()
}
}

impl<'a> Index<&str> for List {
impl Index<&str> for List {
type Output = usize;

fn index(&self, index: &str) -> &Self::Output {
Expand Down

0 comments on commit c7d5b5e

Please sign in to comment.