common/btrfs: rename and enhance _require_btrfs to _require_btrfs_command
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Thu, 8 Dec 2016 08:12:12 +0000 (16:12 +0800)
committerEryu Guan <eguan@redhat.com>
Fri, 9 Dec 2016 07:54:19 +0000 (15:54 +0800)
commit47bb69de19c601dcf18f42b7f109a6ee9f8edd19
tree3e75078d312ebbf6790a000e5d5231aa0b5387f4
parent490baac3805a26c33e1bcd6f1f769259f60960eb
common/btrfs: rename and enhance _require_btrfs to _require_btrfs_command

Rename _require_btrfs() to _require_btrfs_command() to avoid
confusion, as all other _require_btrfs_* has a quite clear suffix,
like _require_btrfs_mkfs_feature() or _require_btrfs_fs_feature().

Also enhance _require_btrfs_command() to accept 2nd level commands
or options.

Options will be determined by the first "-" char.  This is quite
useful for case like "btrfs inspect-internal dump-tree" and "btrfs
check --qgroup-report".

[eguan: make local vars in _require_btrfs_command "local"]

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/btrfs
tests/btrfs/004
tests/btrfs/048
tests/btrfs/059
tests/btrfs/131