2 releases
new 0.1.1 | Nov 7, 2024 |
---|---|
0.1.0 | Nov 7, 2024 |
#1610 in Command line utilities
10KB
105 lines
Header Remake
Header Remake is a CLI tool inspired by headers by transmission11
.
This tool generates customizable, visually appealing comment headers for programming files. With options for symbols, length, and format, Header Remake makes it easy to add professional, readable headers to code files.
Features
- Custom Symbols: Style your headers with any symbol (e.g.,
#
for Python,//
for JavaScript). - Adjustable Length: Define the total length of the header line for consistent formatting.
- Single-Line or Boxed Headers: Choose between single-line headers or boxed multi-line headers.
- Clipboard Integration: Automatically copies the generated header to your clipboard for quick pasting.
- Error Handling: Provides helpful error messages for unsupported inputs or clipboard issues.
Installation
-
By Cloning the Repository
- Clone the repository:
git clone https://github.com/ArshilHapani/Header-remake cd Header-remake
- Build the project:
cargo build --release
- Clone the repository:
-
By Downloading the Binary
- Download the latest binary from the releases page.
- Directly download the binary from here
Usage
Run the headers
command with any of the options below to create a custom header:
headers [OPTIONS] [TITLE]
- TITLE is optional; if omitted, it defaults to "Title."
Options
Option | Description |
---|---|
-s , --symbol |
Set the symbol for the header (default: / ). |
-l , --length |
Set the total length of the header line (default: 50 ). |
-sl , --single-line |
Generate a single-line header instead of a boxed header. |
-h , --help |
Display help information. |
Examples
-
Basic Header:
headers "My Project"
Creates a 50-character header with the title "MY PROJECT" centered using
/
. -
Custom Symbol and Length:
headers -s "#" -l 60 "My Header"
Creates a 60-character header with
#
symbols surrounding "MY HEADER". -
Single-Line Header:
headers -sl -s "//" "Single Line"
Generates a single-line header formatted with
//
symbols. -
Default Header:
headers
Creates a default 50-character header using
/
and the title "TITLE".
Errors
- Length Too Short: If the specified length is too small to accommodate the title, an error message appears.
- Clipboard Issues: If clipboard access fails, an error message notifies the user.
Contributing
Contributions are welcome! Please submit issues or create pull requests for improvements or new features.
License
This project is licensed under the MIT License.
Acknowledgment to the original headers project by transmission11
.
Dependencies
~1–12MB
~157K SLoC