Skip to content
Snippets Groups Projects
Commit 96125675 authored by Moe Jette's avatar Moe Jette
Browse files

Add sfree option --bglblock

parent e52bf30b
No related branches found
No related tags found
No related merge requests found
...@@ -41,16 +41,17 @@ void parse_command_line(int argc, char *argv[]) ...@@ -41,16 +41,17 @@ void parse_command_line(int argc, char *argv[])
int option_index; int option_index;
static struct option long_options[] = { static struct option long_options[] = {
{"all", required_argument, 0, 'a'}, {"all", required_argument, 0, 'a'},
{"partition", no_argument, 0, 'p'}, {"bglblock", required_argument, 0, 'b'},
{"version", no_argument, 0, 'V'}, {"partition", required_argument, 0, 'p'},
{"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'},
{"usage", no_argument, 0, 'u'}, {"help", no_argument, 0, 'h'},
{"usage", no_argument, 0, 'u'},
{NULL, 0, 0, 0} {NULL, 0, 0, 0}
}; };
while ((opt_char = while ((opt_char =
getopt_long(argc, argv, "ahup:V", getopt_long(argc, argv, "ab:hup:V",
long_options, &option_index)) != -1) { long_options, &option_index)) != -1) {
switch (opt_char) { switch (opt_char) {
case (int) '?': case (int) '?':
...@@ -64,6 +65,7 @@ void parse_command_line(int argc, char *argv[]) ...@@ -64,6 +65,7 @@ void parse_command_line(int argc, char *argv[])
case (int) 'V': case (int) 'V':
_print_version(); _print_version();
exit(0); exit(0);
case (int) 'b':
case (int) 'p': case (int) 'p':
bgl_part_id = optarg; bgl_part_id = optarg;
break; break;
...@@ -112,14 +114,17 @@ static void _print_version(void) ...@@ -112,14 +114,17 @@ static void _print_version(void)
static void _usage(void) static void _usage(void)
{ {
printf("Usage: sfree [-huVca] [-p]\n"); printf("Usage: sfree [-huVa] [-b]\n");
} }
static void _help(void) static void _help(void)
{ {
/* We still honor -p and --partition,
* but don't tell users about them here */
printf("\ printf("\
Usage: sfree [OPTIONS]\n\ Usage: sfree [OPTIONS]\n\
-p, --partition free specific bglblock named\n\ -b, --bglblock free specific bglblock named\n\
-a, --all free all bglblocks\n\ -a, --all free all bglblocks\n\
-V, --version output version information and exit\n\ -V, --version output version information and exit\n\
\nHelp options:\n\ \nHelp options:\n\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment