1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

cryptsetup: add a terse help

This commit is contained in:
Lennart Poettering 2011-02-25 02:56:27 +01:00
parent 446f004656
commit dd5e696d93

View File

@ -207,6 +207,17 @@ finish:
return mp;
}
static int help(void) {
printf("%s attach VOLUME SOURCEDEVICE [PASSWORD] [OPTIONS]\n"
"%s detach VOLUME\n\n"
"Attaches or detaches an encrypted block device.\n",
program_invocation_short_name,
program_invocation_short_name);
return 0;
}
int main(int argc, char *argv[]) {
int r = EXIT_FAILURE;
struct crypt_device *cd = NULL;
@ -214,6 +225,11 @@ int main(int argc, char *argv[]) {
const char *cipher = NULL, *cipher_mode = NULL, *hash = NULL, *name = NULL;
char *description = NULL, *name_buffer = NULL, *mount_point = NULL;
if (argc <= 1) {
help();
return EXIT_SUCCESS;
}
if (argc < 3) {
log_error("This program requires at least two arguments.");
return EXIT_FAILURE;