Commit 7a256e75 7a256e75c39bde0ce2ac09ed207ed1734c8177c3 by Sergey Poznyakoff

New option --create

1 parent c2dbb827
...@@ -68,6 +68,7 @@ static struct argp_option options[] = ...@@ -68,6 +68,7 @@ static struct argp_option options[] =
68 { "modify", 'm', 0, 0, N_("Modify user's record (change password)"), 1 }, 68 { "modify", 'm', 0, 0, N_("Modify user's record (change password)"), 1 },
69 { "delete", 'd', 0, 0, N_("Delete user's record"), 1 }, 69 { "delete", 'd', 0, 0, N_("Delete user's record"), 1 },
70 { "list", 'l', 0, 0, N_("List the contents of DBM file"), 1 }, 70 { "list", 'l', 0, 0, N_("List the contents of DBM file"), 1 },
71 { "create", 'c', 0, 0, N_("Create the DBM from a plaintext file"), 1 },
71 72
72 { NULL, 0, NULL, 0, 73 { NULL, 0, NULL, 0,
73 N_("Default action is:\n" 74 N_("Default action is:\n"
...@@ -112,7 +113,12 @@ popauth_parse_opt (int key, char *arg, struct argp_state *astate) ...@@ -112,7 +113,12 @@ popauth_parse_opt (int key, char *arg, struct argp_state *astate)
112 check_action (ap->action); 113 check_action (ap->action);
113 ap->action = ACT_ADD; 114 ap->action = ACT_ADD;
114 break; 115 break;
115 116
117 case 'c':
118 check_action (ap->action);
119 ap->action = ACT_CREATE;
120 break;
121
116 case 'l': 122 case 'l':
117 check_action (ap->action); 123 check_action (ap->action);
118 ap->action = ACT_LIST; 124 ap->action = ACT_LIST;
......