cfg-format

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 6 Imported by: 0

README

CFG-FORMAT

[!NOTE] the code in repo is AI assisted

main grammar and treesitter logic is based on kamaizen

KamaiZen/kamailio_cfg/parser.c          → cfg-format/grammar/parser.c
KamaiZen/kamailio_cfg/include.h         → cfg-format/grammar/include.h
KamaiZen/kamailio_cfg/tree_sitter/*.h   → cfg-format/grammar/tree_sitter/

Pre-requisites

  • make sure you have golang installed.

Installation

git clone https://github.com/IbrahimShahzad/cfg-format.git
cd cfg-format
make install

usage

Usage: cfg-format [flags] [file ...]
  Formats Kamailio .cfg files. Reads stdin when no files are given.

  -check
        exit non-zero if any file is not already formatted
  -dump-tree
        print the parse tree and exit (debug)
  -indent int
        indent width (only used with -spaces) (default 4)
  -spaces
        use spaces instead of tabs for indentation (default true)
  -w    write result back to source file instead of stdout
  -width int
        max line length before if/while conditions are wrapped (default 79)

uinstall

make uninstall

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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