Skip to content

Commit

Permalink
Merge pull request #195 from kyoheiu/develop
Browse files Browse the repository at this point in the history
v2.2.6: Remove -v option
  • Loading branch information
kyoheiu authored Apr 23, 2023
2 parents 729ffdb + 61ee275 commit d2bbb17
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 128 deletions.
235 changes: 173 additions & 62 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "felix"
version = "2.2.5"
version = "2.2.6"
authors = ["Kyohei Uto <[email protected]>"]
edition = "2021"
description = "tui file manager with vim-like key mapping"
Expand Down
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[![crates.io](https://img.shields.io/crates/v/felix)](https://crates.io/crates/felix) ![arch linux](https://img.shields.io/archlinux/v/community/x86_64/felix-rs) ![MSRV](https://img.shields.io/badge/MSRV-1.60.0-orange)
[![crates.io](https://img.shields.io/crates/v/felix)](https://crates.io/crates/felix)
![arch linux](https://img.shields.io/archlinux/v/community/x86_64/felix-rs)
![MSRV](https://img.shields.io/badge/MSRV-1.60.0-orange)

# _felix_

A tui file manager with Vim-like key mapping, written in Rust.
A tui file manager with Vim-like key mapping, written in Rust.\
Fast, simple, and easy to configure & use.

For an overview of this app, take a look at this README, especially [key manual](#key-manual).
For an overview of this app, take a look at this README, especially
[key manual](#key-manual).\
For more detailed document, visit https://kyoheiu.dev/felix.

- [New release](#new-release)
Expand All @@ -23,20 +26,32 @@ For more detailed document, visit https://kyoheiu.dev/felix.

## New release

## v2.2.6 (2023-04-24)

### Removed

- Remove duplicated `-v | --version` option. This is because i) Since some users
do not have `cargo` installed, fetching latest version via `cargo` doesn't
work for many, and ii) `-h | --help` option can already show the current
version.

## v2.2.5 (2023-02-12)

### Added

- Allow renaming even when item name contains non-ascii chars (i.e. wide chars).
- Key command with arguments is now supported: For example,
```
exec:
'feh -.':
[jpg, jpeg, png, gif, svg, hdr]
```
this configuration enables you to execute `feh -. <item path>` by `Enter | l | Right`, or `o`.
this configuration enables you to execute `feh -. <item path>` by
`Enter | l | Right`, or `o`.
- Check for out-of-boundary of the cursor at the top of loop.

### Fixed

- Display when using in kitty: Correctly show the cursor and preview.

For more details, see `CHANGELOG.md`.
Expand All @@ -52,13 +67,21 @@ For more details, see `CHANGELOG.md`.
| MacOS | works |
| Windows | not fully tested yet |

_For Windows users: From v1.3.0, it can be at least compiled on Windows (see `.github/workflows/install_test.yml`.) If you're interested, please try and report any problems._
_For Windows users: From v1.3.0, it can be at least compiled on Windows (see
`.github/workflows/install_test.yml`.) If you're interested, please try and
report any problems._

<a id="installation"></a>

## Installation

### Prerequisites
| package | installation command | notes |
| ---------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| crates.io | `cargo install felix` | |
| Arch Linux | `pacman -S felix-rs` | The binary name is `felix` if you install via pacman. Alias `fx='felix'` if you want, as this document (and other installations) uses `fx`. |
| NetBSD | `pkgin install felix` | |

### From this repository

- Make sure that `gcc` is installed.
- MSRV(Minimum Supported rustc Version): **1.60.0**
Expand All @@ -69,31 +92,6 @@ Update Rust if rustc < 1.60:
rustup update
```

### From crates.io

```
cargo install felix
```

### Arch Linux

```
pacman -S felix-rs
```

*The launcher binary name is `felix` via pacman.
Alias fx='felix' if you want, as this document (and other installations) uses `fx`.*

### NetBSD

Available from the official repositories.

```
pkgin install felix
```

### From this repository

```
git clone https://github.com/kyoheiu/felix.git
cd felix
Expand All @@ -106,16 +104,19 @@ cargo install --path .

In addition, you can use felix more conveniently by installing these two apps:

- [zoxide](https://github.com/ajeetdsouza/zoxide): A smarter `cd` command, which enables you to jump to a directory that matches the keyword in felix.
- [chafa](https://hpjansson.org/chafa/): Terminal graphics for the 21st century, by which you can preview images in felix. ***chafa must be v1.10.0 or later.***
- [zoxide](https://github.com/ajeetdsouza/zoxide): A smarter `cd` command, which
enables you to jump to a directory that matches the keyword in felix.
- [chafa](https://hpjansson.org/chafa/): Terminal graphics for the 21st century,
by which you can preview images in felix. _**chafa must be v1.10.0 or
later.**_

These apps do not need any configuration to use with felix!

<a id="usage"></a>

## Usage

*If you install this app via pacman, the default binary name is `felix`.*
_If you install this app via pacman, the default binary name is `felix`._

```
`fx` => Show items in the current directory.
Expand All @@ -127,7 +128,6 @@ Both relative and absolute path available.

```
`-h` | `--help` => Print help.
`-v` | `--version` => Check update.
`-l` | `--log` => Launch the app, automatically generating a log file in `{data_local_dir}/felix/log`.
```

Expand Down Expand Up @@ -179,7 +179,7 @@ Esc :Return to the normal mode.

## Preview feature

By default, text files and directories can be previewed.
By default, text files and directories can be previewed.\
Install `chafa` and you can preview images without any configuration.

<a id="configuration"></a>
Expand Down
24 changes: 0 additions & 24 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,30 +252,6 @@ pub fn init_log(data_local_path: &Path) -> Result<(), FxError> {
Ok(())
}

/// Check the latest version of felix.
pub fn check_version() -> Result<(), FxError> {
let output = std::process::Command::new("cargo")
.args(["search", "felix", "--limit", "1"])
.output()?
.stdout;
if !output.is_empty() {
if let Ok(ver) = std::str::from_utf8(&output) {
let latest: String = ver.chars().skip(9).take_while(|x| *x != '\"').collect();
let current = env!("CARGO_PKG_VERSION");
if latest != current {
println!("felix v{}: Latest version is {}.", current, latest);
} else {
println!("felix v{}: Up to date.", current);
}
} else {
println!("Cannot read the version.");
}
} else {
println!("Cannot fetch the latest version: Check your internet connection.");
}
Ok(())
}

/// linux-specific: Convert u32 to permission-ish string.
pub fn convert_to_permissions(permissions: u32) -> String {
let permissions = format!("{permissions:o}");
Expand Down
2 changes: 1 addition & 1 deletion src/help.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Help text.
pub const HELP: &str = "# felix v2.2.5
pub const HELP: &str = "# felix v2.2.6
A simple TUI file manager with vim-like keymapping.
## Usage
Expand Down
3 changes: 0 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ fn main() -> Result<(), errors::FxError> {
"-h" | "--help" => {
print!("{}", help::HELP);
}
"-v" | "--version" => {
functions::check_version()?;
}
"-l" | "--log" => {
if let Err(e) = run::run(
std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")),
Expand Down

0 comments on commit d2bbb17

Please sign in to comment.