summaryrefslogtreecommitdiff
path: root/src/cryptsetup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-02-25 02:56:27 +0100
committerLennart Poettering <lennart@poettering.net>2011-02-25 02:56:27 +0100
commitdd5e696d93f70bbfaf8423682e7731fefa83f828 (patch)
tree8a193d9dfd6b47547f9d2f5493877ad3bea87cc5 /src/cryptsetup.c
parent446f00465636f625ea56229f23cadfb6c6f12aae (diff)
cryptsetup: add a terse help
Diffstat (limited to 'src/cryptsetup.c')
-rw-r--r--src/cryptsetup.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cryptsetup.c b/src/cryptsetup.c
index 506ce9b5c9..989734be1b 100644
--- a/src/cryptsetup.c
+++ b/src/cryptsetup.c
@@ -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;