Crates.io | hf |
lib.rs | hf |
version | 0.3.6 |
source | src |
created_at | 2022-05-26 22:45:23.536997 |
updated_at | 2024-08-04 10:34:03.257827 |
description | Cross-platform hidden file library and utility |
homepage | https://sorairolake.github.io/hf/ |
repository | https://github.com/sorairolake/hf |
max_upload_size | |
id | 594548 |
size | 101,533 |
hf is a cross-platform hidden file library and utility.
cargo install hf
The release page contains pre-built binaries for Linux, macOS and Windows.
Please see BUILD.adoc.
Don't actually hide anything, just show what would be done:
hf hide -n data.txt
Actually hide files:
hf hide -f data.txt
Don't actually show anything, just show what would be done:
hf show -n .data.txt
Actually show hidden files:
hf show -f .data.txt
--generate-completion
option generates shell completions to standard output.
The following shells are supported:
bash
elvish
fish
nushell
powershell
zsh
Example:
hf --generate-completion bash > hf.bash
This crate is also available as a library.
Add this to your Cargo.toml
to use it as a library:
[dependencies]
hf = { version = "0.3.6", default-features = false }
By default, the dependencies required to build the application are also built.
If you disable the default
feature, only the dependencies required to build
the library will be built.
use std::fs::File;
let temp_dir = tempfile::tempdir().unwrap();
let file_path = temp_dir.path().join("foo.txt");
File::create(&file_path).unwrap();
assert!(!hf::is_hidden(&file_path).unwrap());
hf::hide(&file_path).unwrap();
// Change the file name to start with `.`.
#[cfg(unix)]
let file_path = hf::unix::hidden_file_name(&file_path).unwrap();
assert!(hf::is_hidden(&file_path).unwrap());
hf::show(&file_path).unwrap();
// Change the file name to start with a character other than `.`.
#[cfg(unix)]
let file_path = hf::unix::normal_file_name(&file_path).unwrap();
assert!(!hf::is_hidden(file_path).unwrap());
See the documentation for more details.
The minimum supported Rust version (MSRV) of this library is v1.74.0.
Please see the following:
Please see CHANGELOG.adoc.
Please see CONTRIBUTING.adoc.
Copyright © 2022–2024 Shun Sakai (see AUTHORS.adoc)
This project is compliant with version 3.2 of the REUSE Specification. See copyright notices of individual files for more details on copyright and licensing information.