]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - bcachefs.c
Add manpage for mount command
[bcachefs-tools-debian] / bcachefs.c
index 495395b44091c6c08208c9c4f0b84feeb159ddaa..f6148e2903ff5ea099023a560a05556a40fc0c04 100644 (file)
@@ -33,18 +33,22 @@ static void usage(void)
             "Superblock commands:\n"
             "  format                   Format a new filesystem\n"
             "  show-super               Dump superblock information to stdout\n"
+            "  set-option               Set a filesystem option\n"
+            "\n"
+            "Mount:\n"
+            "  mount                    Mount a filesystem\n"
             "\n"
             "Repair:\n"
             "  fsck                     Check an existing filesystem for errors\n"
             "\n"
-            "Startup/shutdown, assembly of multi device filesystems:\n"
 #if 0
+            "Startup/shutdown, assembly of multi device filesystems:\n"
             "  assemble                 Assemble an existing multi device filesystem\n"
             "  incremental              Incrementally assemble an existing multi device filesystem\n"
             "  run                      Start a partially assembled filesystem\n"
             "  stop                     Stop a running filesystem\n"
-#endif
             "\n"
+#endif
             "Commands for managing a running filesystem:\n"
             "  fs usage                 Show disk usage\n"
             "\n"
@@ -59,9 +63,9 @@ static void usage(void)
             "  device resize-journal    Resize journal on a device\n"
             "\n"
             "Commands for managing subvolumes and snapshots:\n"
-            "  subvolume create     Create a new subvolume\n"
-            "  subvolume delete     Delete an existing subvolume\n"
-            "  subvolume snapshot   Create a snapshot\n"
+            "  subvolume create         Create a new subvolume\n"
+            "  subvolume delete         Delete an existing subvolume\n"
+            "  subvolume snapshot       Create a snapshot\n"
             "\n"
             "Commands for managing filesystem data:\n"
             "  data rereplicate         Rereplicate degraded data\n"
@@ -177,7 +181,7 @@ int main(int argc, char *argv[])
        setvbuf(stdout, NULL, _IOLBF, 0);
 
        char *cmd = pop_cmd(&argc, argv);
-       if (argc < 1) {
+       if (!cmd) {
                puts("missing command\n");
                goto usage;
        }
@@ -199,12 +203,8 @@ int main(int argc, char *argv[])
                return cmd_version(argc, argv);
        if (!strcmp(cmd, "show-super"))
                return cmd_show_super(argc, argv);
-
-       if (argc < 2) {
-               printf("%s: missing command\n", argv[0]);
-               usage();
-               exit(EXIT_FAILURE);
-       }
+       if (!strcmp(cmd, "set-option"))
+               return cmd_set_option(argc, argv);
 
 #if 0
        if (!strcmp(cmd, "assemble"))
@@ -235,10 +235,17 @@ int main(int argc, char *argv[])
                return cmd_list(argc, argv);
        if (!strcmp(cmd, "list_journal"))
                return cmd_list_journal(argc, argv);
+       if (!strcmp(cmd, "kill_btree_node"))
+               return cmd_kill_btree_node(argc, argv);
 
        if (!strcmp(cmd, "setattr"))
                return cmd_setattr(argc, argv);
 
+       if (!strcmp(cmd, "mount")) {
+               cmd_mount(argc, argv);
+               return 0;
+       }
+
 #ifdef BCACHEFS_FUSE
        if (!strcmp(cmd, "fusemount"))
                return cmd_fusemount(argc, argv);