converge

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 11 Imported by: 0

README

Build Lint Test

Converge

Converge is a CLI tool designed for merging multiple Go source files into a single file. It provides a streamlined approach for consolidating Go package structures, simplifying code sharing, and other scenarios where amalgamating Go files is beneficial.

Features

  • Efficiently merges multiple Go source files from a specified directory into a single consolidated file.
  • Allows exclusion of specific files from the merging process.
  • Supports an optional timeout setting for the merge operation.
  • Employs a configurable worker pool for enhanced concurrency management.

Installation

To install Converge, ensure Go is installed on your machine.

which go

You can install Converge using the following command:

go install github.com/dannyhinshaw/converge

Usage

Run Converge with the command below, specifying the source directory and (optionally) the output file:

converge <source-directory> --file=<output-file>

Options

-f, --file          Path to the output file where the merged content will be written;
                    defaults to stdout if not specified.
-v                  Enable verbose logging for debugging purposes.
-h, --help          Show this help message and exit.
--version           Show version information.
-t, --timeout       Maximum time (in seconds) before cancelling the merge operation;
                    if not specified, the command runs until completion.
-w, --workers       Maximum number of concurrent workers in the worker pool.
-e, --exclude       Comma-separated list of filenames to exclude from merging.

Example

To merge all Go files in the 'src' directory into 'merged.go':

converge ./src --file=./merged.go

To merge all Go files in the 'src' directory and pipe to clipboard:

converge ./src | pbcopy

For more detailed usage instructions, refer to the tool's help message:

converge --help

License

Converge is licensed under the MIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL