uncmnt

command module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 11 Imported by: 0

README

uncmnt

uncmnt

Go Reference

A CLI tool written in Go that removes comments from a specified file and outputs the clean code to stdout.

Usage

uncmnt [options] <file> [file...]

Lines are dropped if they are blank, contain only whitespace, or start with !, #, or ; (leading whitespace ignored). Multiple files are each processed and their results printed to stdout in order.

Options
Flag Description
-h, -help Show help
-v, -version Show version information (tag plus commit hash, when available)
-update Update uncmnt to the latest release
-debug Print detailed, timestamped debug output to stdout
-c, -config Force uncmnt to use this config file path
Output

Messages are color-coded by level: normal output is uncolored, warnings are orange, errors are red, and (with -debug) debug messages are gray and timestamped.

Configuration

By default, a line is a comment if it starts with !, #, or ;. To override which prefixes count as comments, add a config.yml (or config.yaml) with a comment_prefixes list, at either location below. The first one found is used, in this priority order:

  1. config.yml/config.yaml in the directory you run uncmnt from
  2. ~/.config/uncmnt/config.yml/config.yaml

Pass -c/-config with a path to use that config file instead, bypassing the search above entirely. Unlike the automatic search, a missing -c/-config path is an error.

comment_prefixes:
  - "#"
  - "//"
  - "--"

When a config file is found and its comment_prefixes list is non-empty, it replaces the built-in prefixes entirely for that run. See config.yml.example.

Install

go install github.com/sig9org/uncmnt@latest

License

MIT — see LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
config
Package config loads uncmnt's optional comment-rule overrides from a config.yml/config.yaml file.
Package config loads uncmnt's optional comment-rule overrides from a config.yml/config.yaml file.
uncomment
Package uncomment strips comment and blank lines from text files.
Package uncomment strips comment and blank lines from text files.
update
Package update implements self-updating uncmnt from its GitHub releases.
Package update implements self-updating uncmnt from its GitHub releases.
version
Package version holds uncmnt's build-time version metadata.
Package version holds uncmnt's build-time version metadata.

Jump to

Keyboard shortcuts

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