<commit_before>// --------------------------------------------------------------------------
#include <string>
#include <getopt.h>
#include "Debug.h"
#include "MBSlave.h"
#include "ComPort485F.h"
// --------------------------------------------------------------------------
using namespace UniSetTypes;
using namespace std;
// --------------------------------------------------------------------------
static struct option longopts[] = {
	{ "help", no_argument, 0, 'h' },
	{ "device", required_argument, 0, 'd' },
	{ "verbose", no_argument, 0, 'v' },
	{ "myaddr", required_argument, 0, 'a' },
	{ "speed", required_argument, 0, 's' },
	{ "f485", no_argument, 0, 'g' },
	{ NULL, 0, 0, 0 }
};
// --------------------------------------------------------------------------
static void print_help()
{
	printf("-h|--help 		     - this message\n");
	printf("[-t|--timeout] msec  - Timeout. Default: 2000.\n");
	printf("[-v|--verbose]       - Print all messages to stdout\n");
	printf("[-d|--device] dev    - use device dev. Default: /dev/ttyS0\n");
	printf("[-a|--myaddr] addr   - Modbus address for master. Default: 0x01.\n");
	printf("[-s|--speed] speed   - 9600,14400,19200,38400,57600,115200. Default: 38400.\n");
	printf("[-v|--verbose]       - Print all messages to stdout\n");
	printf("[-g|--f485]          - Use 485 Fastwel\n");
}
// --------------------------------------------------------------------------
int main( int argc, char **argv )
{   
	int optindex = 0;
	int opt = 0;
	int verb = 0;
	int f485 = 0;
	string dev("/dev/ttyS0");
	string speed("38400");
	ModbusRTU::ModbusAddr myaddr = 0x01;
	int tout = 2000;
	DebugStream dlog;


	try
	{
		while( (opt = getopt_long(argc, argv, "hva:d:s:c:",longopts,&optindex)) != -1 ) 
		{
			switch (opt) <commit_msg>(modbus): исправил ошибку в help (eterbug #9290)<commit_after>// --------------------------------------------------------------------------
#include <string>
#include <getopt.h>
#include "Debug.h"
#include "MBSlave.h"
#include "ComPort485F.h"
// --------------------------------------------------------------------------
using namespace UniSetTypes;
using namespace std;
// --------------------------------------------------------------------------
static struct option longopts[] = {
	{ "help", no_argument, 0, 'h' },
	{ "device", required_argument, 0, 'd' },
	{ "verbose", no_argument, 0, 'v' },
	{ "myaddr", required_argument, 0, 'a' },
	{ "speed", required_argument, 0, 's' },
	{ "f485", no_argument, 0, 'g' },
	{ NULL, 0, 0, 0 }
};
// --------------------------------------------------------------------------
static void print_help()
{
	printf("-h|--help 		     - this message\n");
	printf("[-t|--timeout] msec  - Timeout. Default: 2000.\n");
	printf("[-v|--verbose]       - Print all messages to stdout\n");
	printf("[-d|--device] dev    - use device dev. Default: /dev/ttyS0\n");
	printf("[-a|--myaddr] addr   - Modbus address for this slave. Default: 0x01.\n");
	printf("[-s|--speed] speed   - 9600,14400,19200,38400,57600,115200. Default: 38400.\n");
	printf("[-v|--verbose]       - Print all messages to stdout\n");
	printf("[-g|--f485]          - Use 485 Fastwel\n");
}
// --------------------------------------------------------------------------
int main( int argc, char **argv )
{   
	int optindex = 0;
	int opt = 0;
	int verb = 0;
	int f485 = 0;
	string dev("/dev/ttyS0");
	string speed("38400");
	ModbusRTU::ModbusAddr myaddr = 0x01;
	int tout = 2000;
	DebugStream dlog;


	try
	{
		while( (opt = getopt_long(argc, argv, "hva:d:s:c:",longopts,&optindex)) != -1 ) 
		{
			switch (opt) 
{'fraction_non_alphanumeric': 0.3704743193937693, 'fraction_numerical': 0.048835251192815045, 'mean_word_length': 1.5493562231759657, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '639612', 'n_tokens_mistral': 1267, 'n_tokens_neox': 1128, 'n_words': 277}