-#include <nih/option.h>
-
#include "bcache.h"
struct bcache_fs {
int cmd_fs_show(int argc, char *argv[])
{
- NihOption opts[] = {
- // { int shortoption, char *longoption, char *help, NihOptionGroup, char *argname, void *value, NihOptionSetter}
- NIH_OPTION_LAST
- };
- char **args = bch_nih_init(argc, argv, opts);
-
- if (nr_args(args) != 1)
+ if (argc != 2)
die("Please supply a filesystem");
- struct bcache_handle fs = bcache_fs_open(args[0]);
+ struct bcache_handle fs = bcache_fs_open(argv[1]);
return 0;
}
int cmd_fs_set(int argc, char *argv[])
{
- NihOption opts[] = {
- // { int shortoption, char *longoption, char *help, NihOptionGroup, char *argname, void *value, NihOptionSetter}
- NIH_OPTION_LAST
- };
- char **args = bch_nih_init(argc, argv, opts);
-
- if (nr_args(args) < 1)
+ if (argc != 2)
die("Please supply a filesystem");
- struct bcache_handle fs = bcache_fs_open(args[0]);
+ struct bcache_handle fs = bcache_fs_open(argv[1]);
return 0;
}