Skip to content

Commit

Permalink
Version 0.3.0 changes
Browse files Browse the repository at this point in the history
- Main function rework
- New options were added: dry run and default text
- README file renamed
  • Loading branch information
AlexWanderman committed Nov 14, 2023
1 parent 8088ea6 commit e5d8737
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 144 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
Cargo.lock
7 changes: 0 additions & 7 deletions Cargo.lock

This file was deleted.

8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[package]
name = "mkfile"
version = "0.2.1"
authors = ["Alex Wanderman <[email protected]>"]
version = "0.3.0"
edition = "2021"
description = "Rust CLI app to create text files. No external dependencies."
readme = "readme.md"
authors = ["Alex Wanderman <[email protected]>"]
description = "CLI app for creating text files (with no external dependencies)."
repository = "https://github.com/AlexWanderman/mkfile"
license = "MIT"
categories = ["command-line-utilities"]
exclude = [".github"]
55 changes: 55 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Overview ![Crates.io](https://img.shields.io/crates/v/mkfile)

Minimal Rust CLI app with no external dependencies. Creates text files. May
create parent directories recursively, override existing files and output
verbosely. Default text for new files supported.

Install with `cargo install mkfile`.

# Description

mkfile \[OPTION\]... PATH...

Options:
- -d --dry - perform "dry" run, always verbose;
- -v --verbose - print a message for each file;
- -p --parents - create parent directories recursively;
- -o --override - override already existing files;
- -T --text "STRING" - default text for each file;
- --help - display help message and exit;
- --version - display version message and exit.

# Usage example

Basic example. Create new file silently.
```
$ mkfile file.txt
```

Create multiple files (with text, verbosely).
```
$ mkfile file1.txt file2.txt file3.txt -vT "Default text"
/home/user/file1.txt: Created
/home/user/file2.txt: Created
/home/user/file3.txt: Created
```

Create file with parent directory (verbosely).
```
$ mkfile -vp parent/file.txt
/home/user/Documents/Rust/mkfile/parent/file.txt: Created with parent
```

Dry run example. Be aware that /root_file.txt will not be created without root privileges.
```
$ mkfile -d new_dir/file.txt new_file.txt existing_file.txt /root_file.txt
/home/user/new_dir/file.txt: Parent does not exist
/home/user/new_file.txt: To be created
/home/user/existing_file.txt: Already exist
/root_file.txt: To be created
```

# TODO

- Create tests
- chmod parameters
46 changes: 0 additions & 46 deletions readme.md

This file was deleted.

Loading

0 comments on commit e5d8737

Please sign in to comment.