I'm happy that I'm not alone with my preference for subcommands :) over short -<one-letter> commands.
Btw: I think it would be a good idea start from the beginning with a 'libbtrfs' library and a corresponding API. That way integrating into other languages like Python and integration into tools like parted (or libparted) would be quite easy. On 18 Feb 2010, at 18:58, Mike Fedyk wrote: > On Thu, Feb 18, 2010 at 8:58 AM, Chris Mason <chris.ma...@oracle.com> wrote: >> I do like the subcommand method, more details below. >> >> On Wed, Feb 17, 2010 at 03:35:26PM -0800, Mike Fedyk wrote: >>> I think he need some command hierarchy here. >>> >>> On Wed, Feb 17, 2010 at 12:02 PM, Goffredo Baroncelli >>> <kreij...@gmail.com> wrote: >>>> OPTIONS >>>> snapshot|-s <source> [<dest>/]<name> >>>> Create a writeble snapshot of the subvolume <source> with >>>> the >>>> name <name> in the <dest> directory. If <source> is not a >>>> sub‐ >>>> volume, btrfs returns an error. >>> >>> This should be "btrfs subvolume snapshot <source> [<dest>/]<name>". >>> It only works on subvolumes. >> >> If we can type subvol instead of subvolume I like it. Basically the >> perl/python arg parsing system where any short form of the command that >> uniquely matches it is allowed. >> >> We keep the long forms but allow the user to pick a shorter form if it >> isn't ambiguous. >> > > Yes, I agree. This is why I compared it with the ip command which > does the same. > >>> >>>> >>>> >>>> delete|-D <subvolume> >>>> Delete the subvolume <subvolume>. If <subvolume> is not a >>>> sub‐ >>>> volume, btrfs returns an error. >>>> >>> >>> This becomes: >>> >>> btrfs subvolume delete <subvolume> >> >> subvol del (same as above). >> >>> >>> This works with snapshots as well. >>> >>>> >>>> subvolume|-c [<dest>/]<name> >>>> Create a subvolume in <dest> (or in the current directory >>>> if >>>> <dest> is not passed). >>> >>> btrfs subvolume create [<dest>/]<name> >>> >>>> >>>> >>>> defrag|-f <file>|<dir> [<file>|<dir>...] >>>> Defragment files and/or directories. >>> >>> This will defrag individual files? Does it defrag a directory tree? >>> Does it defrag a subvolume? Does it defrag a pool? >> >> For now lets change this to only do files. That's the only thing the >> tool supports today. >> >>> >>>> >>>> >>>> scan|-n [<device> [<device>..]] >>>> Scan devices for a btrfs filesystem. If no devices are >>>> passed, >>>> btrfs scans all the block devices. >>> >>> btrfs pool scan [<device> [<device>..]] >> >> Instead of btrfs pool, please use btrfs dev >> >>> >>>> >>>> >>>> fssync|-y <path> >>>> Force a sync for the filesystem identified by <path>. >>>> >>> >>> Does it sync a pool or subvolume? Assuming it works against >>> subvolumes, it would be: >>> >>> btrfs subvolume sync <path> >>> >>>> >>>> >>>> resize|-z [+/-]<size>[gkm]|max <filesystem> >>>> Resize a file system identified by <path>. The <size> >>>> parameter >>>> specifies the new size of the filesystem. If the prefix + or >>>> - >>>> is present the size is increased or decreased by the >>>> quantity >>>> <size>. If no units are specified, the unit of the >>>> <size> >>>> parameter is the byte. Optionally, the size parameter may >>>> be >>>> suffixed by one of the following the units designators: >>>> 'K', >>>> 'M', or 'G', kilobytes, megabytes, or gigabytes, respectively. >>>> >>>> If 'max' is passed, the filesystem will occupy all >>>> available >>>> space on the volume(s). >>>> >>>> The resize command does not manipulate the size of >>>> underlying >>>> partitions. If you wish to enlarge/reduce a filesystem, >>>> you >>>> must make sure you can expand/reduce the size of the >>>> partition >>>> also. >>>> >>> >>> This works with physical devices, not a pool or subvolume. I get the >>> name "physical volume" from lvm. Also I think it should resize to max >>> without arguments, in order to do that, the size argument would need >>> to be the last argument. >> >> We don't have physical volumes and logical volumes the way lvm does, so >> I'd like to avoid the pvolume theme. >> >>> >>> It becomes: >>> >>> btrfs pvolume resize [+/-]<size>[gkm]|max <filesystem> >>> >>> Or: >>> >>> btrfs pvolume resize <filesystem> [[+/-]<size>[gkm]] >> >> btrfs dev resize >> > > Dev works for me, I could only think of the lvm terms at the time. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html