udevadm-test-builtin.c revision 07630cea1f3a845c09309f197ac7c4f11edd3b62
/*
* Copyright (C) 2011 Kay Sievers <kay@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <getopt.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include "string-util.h"
#include "udev.h"
printf("%s builtin [--help] COMMAND SYSPATH\n\n"
"Test a built-in command.\n\n"
" -h --help Print this message\n"
" --version Print version of the program\n\n"
"Commands:\n"
}
{}
};
char filename[UTIL_PATH_SIZE];
enum udev_builtin_cmd cmd;
int rc = EXIT_SUCCESS, c;
switch (c) {
case 'h':
goto out;
}
rc = 2;
goto out;
}
rc = 3;
goto out;
}
if (cmd >= UDEV_BUILTIN_MAX) {
rc = 5;
goto out;
}
/* add /sys if needed */
else
rc = 4;
goto out;
}
if (rc < 0) {
rc = 6;
}
out:
return rc;
}
const struct udevadm_cmd udevadm_test_builtin = {
.name = "test-builtin",
.cmd = adm_builtin,
.help = "Test a built-in command",
.debug = true,
};