Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mirryi/cchmod
chmod calculator.
https://github.com/mirryi/cchmod
chmod
Last synced: 28 days ago
JSON representation
chmod calculator.
- Host: GitHub
- URL: https://github.com/mirryi/cchmod
- Owner: mirryi
- License: mit
- Created: 2021-06-21T23:11:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T16:59:09.000Z (9 months ago)
- Last Synced: 2024-12-01T16:54:21.032Z (about 2 months ago)
- Topics: chmod
- Language: Rust
- Homepage:
- Size: 104 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build status](https://github.com/mirryi/cchmod/workflows/ci/badge.svg)](https://github.com/mirryi/cchmod/actions)
[![Crates.io](https://img.shields.io/crates/v/cchmod.svg)](https://crates.io/crates/cchmod)
[![Docs.rs](https://docs.rs/cchmod/badge.svg)](https://docs.rs/cchmod)# cchmod
cchmod is a mode and permission calculator/converter for chmod.
## Install
Install via Cargo:
```bash
$ cargo install cchmod
```## Usage
```bash
$ cchmod
cchmodUSAGE:
cchmod [FLAGS]ARGS:
FLAGS:
-h, --help Prints help information
-n, --num Output the octal form
-s, --sym Output the symbolic form
-V, --version Prints version information
```### Examples
Get the octal form of a mode:
```bash
$ cchmod -n rwxr-xr-x
755
```Get the symbolic form of a mode:
```bash
$ cchmod -s 644
rw-r--r--
```The same operations, on permission values:
```bash
$ cchmod -n r-x
5$ cchmod -s 7
rwx
```### Library
cchmod can be used as a library:
```rust
use cchmod::Mode;let m = Mode::from_sym("rw-r--r--").unwrap();
println!("{}", m.as_num());
```See the [docs](https://docs.rs/cchmod) for more information.