Compare commits
No commits in common. "50a2102d984782cd932cbbe0a98300a2e028a8e8" and "7a708fb76d3ddede951bbaab673d46eadc10081b" have entirely different histories.
50a2102d98
...
7a708fb76d
|
@ -20,10 +20,3 @@ regex = "1.10.2"
|
||||||
[dependencies.clap]
|
[dependencies.clap]
|
||||||
features = ["derive"]
|
features = ["derive"]
|
||||||
version = "4.4.7"
|
version = "4.4.7"
|
||||||
|
|
||||||
[lints.clippy]
|
|
||||||
missing_docs_in_private_items = "warn"
|
|
||||||
|
|
||||||
[lints.rust]
|
|
||||||
missing_docs = "warn"
|
|
||||||
unsafe_code = "forbid"
|
|
||||||
|
|
44
README.md
44
README.md
|
@ -14,58 +14,14 @@ bautils arguments count -- $fruits
|
||||||
|
|
||||||
### Date
|
### Date
|
||||||
|
|
||||||
```sh
|
|
||||||
# Outputs the current date with the ISO 8601 format.
|
|
||||||
bautils date now
|
|
||||||
|
|
||||||
# Set a custom format using `-f` or `--format`.
|
|
||||||
bautils date now -f '%F %T'
|
|
||||||
```
|
|
||||||
|
|
||||||
### Directory
|
### Directory
|
||||||
|
|
||||||
```sh
|
|
||||||
# Checks whether a directory exists, returning an exit code of 1
|
|
||||||
# when it doesn't. This specifically checks for a directory so if
|
|
||||||
# a path exists but it isn't a directory this will also return 1.
|
|
||||||
bautils directory exists 'source'
|
|
||||||
```
|
|
||||||
|
|
||||||
### File
|
### File
|
||||||
|
|
||||||
```sh
|
|
||||||
# Checks whether a file exists, with the same logic as the
|
|
||||||
# `directory exists` command.
|
|
||||||
bautils file exists 'Cargo.toml'
|
|
||||||
|
|
||||||
# Returns metadata of a file, for example `--modified` returning
|
|
||||||
# when the file was last modified.
|
|
||||||
bautils file metadata 'Cargo.toml' --modified
|
|
||||||
|
|
||||||
# Returns parts of a file name.
|
|
||||||
bautils file parts 'source/main.rs' --directory # Outputs: source
|
|
||||||
bautils file parts 'source/main.rs' --basename # Outputs: main
|
|
||||||
bautils file parts 'source/main.rs' --extension # Outputs: rs
|
|
||||||
```
|
|
||||||
|
|
||||||
### Log
|
### Log
|
||||||
|
|
||||||
```sh
|
|
||||||
# Logs data to a file, creating the file if it doesn't exist.
|
|
||||||
bautils log -- 'The data to log!'
|
|
||||||
|
|
||||||
# The log file can be specified with `-f` or `--file`.
|
|
||||||
bautils log -f 'logfile.txt' -- 'More data!'
|
|
||||||
```
|
|
||||||
|
|
||||||
### Match
|
### Match
|
||||||
|
|
||||||
```sh
|
|
||||||
# Matches a regular expression, returning an exit code of 1 if it
|
|
||||||
# is succesful.
|
|
||||||
bautils match regex --pattern '\d' '123'
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Distributed under the [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) license, see [LICENSE](https://git.bauke.xyz/Bauke/bautils/src/branch/main/LICENSE) for more information.
|
Distributed under the [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) license, see [LICENSE](https://git.bauke.xyz/Bauke/bautils/src/branch/main/LICENSE) for more information.
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
//!
|
//!
|
||||||
//! > **Bauke's Ad-hoc Utilities.**
|
//! > **Bauke's Ad-hoc Utilities.**
|
||||||
|
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
|
#![warn(missing_docs, clippy::missing_docs_in_private_items)]
|
||||||
|
|
||||||
mod cli;
|
mod cli;
|
||||||
mod logging;
|
mod logging;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue