Thanks to visit codestin.com
Credit goes to lib.rs

#compiler #cpp #json #cli

app wucc

whs31's utilities and compilers collection

3 unstable releases

Uses new Rust 2024

0.2.1 Oct 29, 2025
0.2.0 Oct 10, 2025
0.1.0 Oct 10, 2025

#2129 in Command line utilities

Custom license

59KB
1.5K SLoC

wucc - whs31's utilities and compilers collection

What is wucc?

wucc is basically a multi-tool for me and my team. It contains a bunch of useful tools and "compilers" (template generators) for C++ development and some other stuff.

Examples

Compile JSON files to a C++ header file
wucc json-to-cpp file1.json file2.json file3.json \
  -O . \
  -o header \
  --namespace my::namespace_ \
  --nlohmann
  
cat header.json.h

Output:

/*
 * Generated by the whs31's ucc compiler (wucc)
 * Source file(s):
 *   - file1.json
 *   - file2.json
 *   - file3.json
 *
 * File stem: header
 *
 * Copyright (c) 2025 whs31
 * https://github.com/whs31/wucc
 * https://crate.io/crates/wucc
 *
 * DO NOT MODIFY. THIS FILE IS AUTO-GENERATED BY THE BUILD SYSTEM
 */
#pragma once

#include <string>
#include <string_view>
#include <nlohmann/json.hpp>

namespace my::namespace_ {

    inline namespace file1 {
        [[maybe_unused]]
        inline auto constexpr file1_c_str = "{\r\n  \"file1_content\": \"meow\"\r\n}\r\n";
    
        [[maybe_unused]]
        static inline auto file1_json = nlohmann::json::parse(file1_c_str);
    } // namespace file1
    
    inline namespace file2 {
    
        [[maybe_unused]]
        inline auto constexpr file2_c_str = "{\r\n  \"file2_content\": \"purr\"\r\n}\r\n";
        
        [[maybe_unused]]
        static inline auto file2_json = nlohmann::json::parse(file2_c_str);
    } // namespace file2
    
    inline namespace file3 {
        [[maybe_unused]]
        inline auto constexpr file3_c_str = "{\r\n  \"file3_content\": \"woof\"\r\n}\r\n";
    
        [[maybe_unused]]
        static inline auto file3_json = nlohmann::json::parse(file3_c_str);
    } // namespace file3

} // namespace my::namespace_
Compile YAML files to a C++ header file
wucc yaml-to-cpp file1.yaml file2.yaml file3.yaml \
  -O . \
  -o header \
  --namespace my::namespace_ \
  --nlohmann
  
cat header.yml.h

Output:

/*
 * Generated by the whs31's ucc compiler (wucc)
 * Source file(s):
 *   - file1.yaml
 *   - file2.yaml
 *   - file3.yaml
 *
 * File stem: header
 *
 * Copyright (c) 2025 whs31
 * https://github.com/whs31/wucc
 * https://crate.io/crates/wucc
 *
 * DO NOT MODIFY. THIS FILE IS AUTO-GENERATED BY THE BUILD SYSTEM
 */
#pragma once

#include <string>
#include <string_view>
#include <nlohmann/json.hpp>

namespace my::namespace_ {

    inline namespace file1 {
        [[maybe_unused]]
        inline auto constexpr file1_c_str = "{\r\n  \"file1_content\": \"meow\"\r\n}\r\n";
    
        [[maybe_unused]]
        static inline auto file1_json = nlohmann::json::parse(file1_c_str);
    } // namespace file1
    
    inline namespace file2 {
    
        [[maybe_unused]]
        inline auto constexpr file2_c_str = "{\r\n  \"file2_content\": \"purr\"\r\n}\r\n";
        
        [[maybe_unused]]
        static inline auto file2_json = nlohmann::json::parse(file2_c_str);
    } // namespace file2
    
    inline namespace file3 {
        [[maybe_unused]]
        inline auto constexpr file3_c_str = "{\r\n  \"file3_content\": \"woof\"\r\n}\r\n";
    
        [[maybe_unused]]
        static inline auto file3_json = nlohmann::json::parse(file3_c_str);
    } // namespace file3
}
Hexdump a file
Show version information
wucc version --show

Output:

 CMakeLists............... 2.76.3
 Conanfile................ 2.76.3
 Export header............ 2.76.3
Assign a version
wucc version --assign 1.2.3

Output:

 CMakeLists............... 2.76.3 -> 1.2.3
 Conanfile................ 2.76.3 -> 1.2.3
 Export header............ 2.76.3 -> 1.2.3
Bump a version
wucc version --bump-patch # or -p
wucc version --bump-minor # or -m
wucc version --bump-major # or -M

Output:

 CMakeLists............... 2.76.3 -> 2.76.4
 Conanfile................ 2.76.3 -> 2.76.4
 Export header............ 2.76.3 -> 2.76.4

 CMakeLists............... 2.76.4 -> 2.77.0
 Conanfile................ 2.76.4 -> 2.77.0
 Export header............ 2.76.4 -> 2.77.0

 CMakeLists............... 2.77.0 -> 3.0.0
 Conanfile................ 2.77.0 -> 3.0.0
 Export header............ 2.77.0 -> 3.0.0

Dependencies

~15–49MB
~746K SLoC