boolfnames - Linux


Overview

boolfnames is a command-line tool that operates on boolean flags/field names extracted from proto files. It is primarily used to generate various types of code and files based on the flags/field names defined in proto files for different programming languages.

Syntax

Usage: boolfnames [flags] <command> [args]
  Commands:
    generate: Generate code based on boolean flags/field names
    list: List boolean flags/field names
    help: Print help

Options/Flags

  • -language, -l: Target programming language (default: "go")
    • Options: "go", "java", "python"
  • -output, -o: Output directory (default: ".")
  • -filename: Output filename (default: "flags.go", "flags.java", "flags.py")
  • -proto: Proto file path (required)
  • -ignorecase: Ignore case when comparing boolean flag names (default: false)
  • -debug: Enable debug mode

Examples

Generate Go code for boolean flags:

boolfnames generate -l=go -o=./myflags -proto=myproto.proto

List boolean flag names from a proto file:

boolfnames list -proto=myproto.proto

Common Issues

  • Error: "Proto file path not specified"
    • Solution: Use the -proto flag to specify the proto file path.
  • Error: "Invalid language specified"
    • Solution: Specify a valid language using the -language flag. Options are "go", "java", and "python".

Integration

Example script to generate code for multiple proto files:

#!/bin/bash

for proto in $(find . -name "*.proto"); do
    boolfnames generate -l=go -o=./generated -proto=$proto
done

Related Commands

  • protoc: Protocol buffer compiler
  • protoc-gen-*: Protocol buffer compiler plugins for specific languages