form_field_opts - Linux


Overview

form_field_opts streamlines the creation of form fields by extracting their data from src files and generating field_opts structs.

Syntax

form_field_opts [FLAGS] --src <path>

Options/Flags

  • –src : The source file containing the form fields
  • –min-group-size : The minimum size of a field group to generate a field_opts struct for. Defaults to 1
  • –output : The output file for the generated field_opts structs. Defaults to stdout
  • –ignore-static-groups: Do not generate field_opts structs for static groups
  • –ignore-normal-fields: Do not generate field_opts structs for normal fields

Examples

Simple usage

form_field_opts --src my_form.fbs --output my_field_opts.h

Ignoring static groups

form_field_opts --src my_form.fbs --output my_field_opts.h --ignore-static-groups

Common Issues

Errors

  • Invalid src file: Make sure the provided source file is valid flatbuffers *.fbs file
  • Field groups less than min-group-size: Adjust the min-group-size flag or manually define field_opts structs for smaller groups

Integration

form_field_opts can be used in scripts or makefiles to automate the generation of field_opts structs. For instance:

#!/bin/bash
form_field_opts --src my_form.fbs --output my_field_opts.h
make -f my_makefile

Related Commands

  • flatc – The Flatbuffers compiler that creates *.fbs files
  • flatbuffer_to_cc – A Python script that generates C++ code from *.fbs files