<commit_before>/*
 *
 * Copyright (c) 2016 <NAME>, Inc.
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#if HAVE_CONFIG_H
#include <config.h>
#endif

#include <getopt.h>
#include "wpanctl-utils.h"
#include "tool-cmd-status.h"
#include "assert-macros.h"
#include "wpan-dbus-v1.h"
#include "args.h"

#define MFG_MAX_COMMAND_SIZE        1300
#define MFG_TIMEOUT_IN_SECONDS      10

int tool_cmd_mfg(int argc, char *argv[])
{
	int ret = 0;
	char command[MFG_MAX_COMMAND_SIZE];
	char *input = &command[0];
	const char *output = NULL;
	int timeout = MFG_TIMEOUT_IN_SECONDS * 1000;
	DBusConnection *connection = NULL;
	DBusMessage *message = NULL;
	DBusMessage *reply = NULL;

	DBusError error;

	dbus_error_init(&error);

	{
		char *buf_ptr = command;
		int buf_len = sizeof(command);
		int index;
		int len;

		for (index = 0; index < argc; index++) {

			len = snprintf(
				buf_ptr,
				buf_len,
				"%s%s",
				(index == 0) ? "" : " ",
				argv[index]
			);

			require(len >= 0, bail);

			if (len >= buf_len) {
				fprintf(stderr, "%s: error: command string exceeds max size %lu \n", argv[0], sizeof(command));
				ret = ERRORCODE_BADARG;
				goto bail;
			}

			buf_ptr += len;
			buf_len -= len;
		}
	}<commit_msg>Do not pass mfg prefix (#432)<commit_after>/*
 *
 * Copyright (c) 2016 <NAME>, Inc.
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#if HAVE_CONFIG_H
#include <config.h>
#endif

#include <getopt.h>
#include "wpanctl-utils.h"
#include "tool-cmd-status.h"
#include "assert-macros.h"
#include "wpan-dbus-v1.h"
#include "args.h"

#define MFG_MAX_COMMAND_SIZE        1300
#define MFG_TIMEOUT_IN_SECONDS      10

int tool_cmd_mfg(int argc, char *argv[])
{
	int ret = 0;
	char command[MFG_MAX_COMMAND_SIZE];
	char *input = &command[0];
	const char *output = NULL;
	int timeout = MFG_TIMEOUT_IN_SECONDS * 1000;
	DBusConnection *connection = NULL;
	DBusMessage *message = NULL;
	DBusMessage *reply = NULL;

	DBusError error;

	dbus_error_init(&error);

	{
		char *buf_ptr = command;
		int buf_len = sizeof(command);
		int index;
		int len;

		for (index = 1; index < argc; index++) {

			len = snprintf(
				buf_ptr,
				buf_len,
				"%s%s",
				(index == 1) ? "" : " ",
				argv[index]
			);

			require(len >= 0, bail);

			if (len >= buf_len) {
				fprintf(stderr, "%s: error: command string exceeds max size %lu \n", argv[0], sizeof(command));
				ret = ERRORCODE_BADARG;
				goto bail;
			}

			buf_ptr += len;
			buf_len -= len;
		}
	}
{'fraction_non_alphanumeric': 0.12146092865232164, 'fraction_numerical': 0.015005662514156285, 'mean_word_length': 3.4496221662468516, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4981209', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1206, 'n_words': 391}