mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
getattr skeleton
This commit is contained in:
parent
8b2a893c6b
commit
8c9dddb00a
36
cmd_attr.c
36
cmd_attr.c
@ -1,4 +1,5 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include <getopt.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -112,3 +113,38 @@ int cmd_setattr(int argc, char *argv[])
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void getattr_usage(void)
|
||||||
|
{
|
||||||
|
puts("bcachefs getattr - get attributes on files in a bcachefs filesystem\n"
|
||||||
|
"Usage: bcachefs getattr <files>\n"
|
||||||
|
"\n"
|
||||||
|
"Options:\n"
|
||||||
|
" -h, --help Display this help and exit\n"
|
||||||
|
"Report bugs to <linux-bcachefs@vger.kernel.org>");
|
||||||
|
}
|
||||||
|
|
||||||
|
int cmd_getattr(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
static const struct option longopts[] = {
|
||||||
|
{ "help", no_argument, NULL, 'h' },
|
||||||
|
{ NULL }
|
||||||
|
};
|
||||||
|
int opt;
|
||||||
|
|
||||||
|
while ((opt = getopt_long(argc, argv, "h",
|
||||||
|
longopts, NULL)) != -1)
|
||||||
|
switch (opt) {
|
||||||
|
case 'h':
|
||||||
|
getattr_usage();
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
default:
|
||||||
|
getattr_usage();
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
args_shift(optind);
|
||||||
|
|
||||||
|
//for (i = 1; i < argc; i++)
|
||||||
|
// do_setattr(argv[i], opts);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user