[go: up one dir, main page]

File: misc.h

package info (click to toggle)
s390-tools 2.15.1-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 8,216 kB
  • sloc: ansic: 130,144; sh: 9,397; cpp: 8,359; perl: 2,517; makefile: 1,960; asm: 1,016
file content (70 lines) | stat: -rw-r--r-- 1,480 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * zkey - Generate, re-encipher, and validate secure keys
 *
 * Local helper functions
 *
 * Copyright IBM Corp. 2017, 2020
 *
 * s390-tools is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef MISC_H
#define MISC_H

#include <err.h>

#include "lib/util_prg.h"

/**
 * Command is missing (for 'git' like tools)
 */
static inline void misc_print_missing_command(void)
{
	warnx("Command is required");
	util_prg_print_parse_error();
}

/**
 * Subcommand is missing
 */
static inline void misc_print_missing_sub_command(void)
{
	warnx("Subcommand is required");
	util_prg_print_parse_error();
}

/**
 * Invalid command specified (for 'git' like tools)
 */
static void misc_print_invalid_command(const char *command)
{
	warnx("Invalid command '%s'", command);
	util_prg_print_parse_error();
}

/**
 * An required parameter has not been specified
 *
 * @param[in] parm_name  Parameter string
 */
static void misc_print_required_parm(const char *parm_name)
{
	warnx("Parameter '%s' is required", parm_name);
	util_prg_print_parse_error();
}

/**
 * An required parameter has not been specified
 *
 * @param[in] parm_name1  Parameter string 1
 * @param[in] parm_name2  Parameter string 2
 */
static void misc_print_required_parms(const char *parm_name1,
				      const char *parm_name2)
{
	warnx("Parameter '%s' or '%s' is required", parm_name1, parm_name2);
	util_prg_print_parse_error();
}

#endif