X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=commands.h;h=d2bb093487932b2d468b4d0193c8c7fdb65716af;hb=f802f572b1cb1d33bab9747e87e6506b284546cf;hp=db700438677e9b229189ecf824f30b76fc7a5dbc;hpb=14ef4f569572ad34254186f1a503c39b735cc167;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/commands.h b/commands.h index db70043..d2bb093 100644 --- a/commands.h +++ b/commands.h @@ -14,7 +14,13 @@ * Boston, MA 021110-1307, USA. */ -#define ARGV0_BUF_SIZE 64 +#ifndef __BTRFS_COMMANDS_H__ +#define __BTRFS_COMMANDS_H__ + +enum { + CMD_HIDDEN = (1 << 0), /* should not be in help listings */ + CMD_ALIAS = (1 << 1), /* alias of next command in cmd_group */ +}; struct cmd_struct { const char *token; @@ -46,8 +52,8 @@ struct cmd_struct { /* should be NULL if token is not a subgroup */ const struct cmd_group *next; - /* if true don't list this token in help listings */ - int hidden; + /* CMD_* flags above */ + int flags; }; #define NULL_CMD_STRUCT {NULL, NULL, NULL, NULL, 0} @@ -62,10 +68,6 @@ struct cmd_group { /* btrfs.c */ int prefixcmp(const char *str, const char *prefix); -int check_argc_exact(int nargs, int expected); -int check_argc_min(int nargs, int expected); -int check_argc_max(int nargs, int expected); - int handle_command_group(const struct cmd_group *grp, int argc, char **argv); @@ -75,6 +77,7 @@ extern const char * const generic_cmd_help_usage[]; void usage(const char * const *usagestr) __attribute__((noreturn)); void usage_command(const struct cmd_struct *cmd, int full, int err); void usage_command_group(const struct cmd_group *grp, int all, int err); +void usage_command_group_short(const struct cmd_group *grp); void help_unknown_token(const char *arg, const struct cmd_group *grp) __attribute__((noreturn)); void help_ambiguous_token(const char *arg, const struct cmd_group *grp) __attribute__((noreturn)); @@ -127,3 +130,5 @@ int test_issubvolume(char *path); /* send.c */ char *get_subvol_name(char *mnt, char *full_path); + +#endif