mirror of
https://github.com/RustySamovar/RustySamovar.git
synced 2024-11-25 03:29:38 +00:00
28 lines
521 B
Bash
Executable File
28 lines
521 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#echo "#[macro_use]";
|
|
#echo "extern crate num_derive;";
|
|
|
|
#echo "";
|
|
|
|
echo "// Autogenerated file, do not edit!"
|
|
|
|
echo "";
|
|
|
|
echo "#[repr(u16)]";
|
|
echo "#[derive(FromPrimitive, ToPrimitive)]";
|
|
echo "#[derive(Debug, PartialEq, Eq, Clone, Hash)]";
|
|
|
|
echo "pub enum PacketId {";
|
|
|
|
for f in protobuf/*; do
|
|
CMD_ID=`cat $f | grep CMD_ID | cut -d'=' -f2 | tr -d ' ;\015'`;
|
|
|
|
if [ "x${CMD_ID}" != "x" ]; then
|
|
NAME=`echo $f | cut -d'/' -f2 | cut -d'.' -f1`;
|
|
echo " ${NAME} = ${CMD_ID},"
|
|
fi
|
|
done
|
|
|
|
echo "}";
|