Re: [PATCH 03/27] xfs_scrub: set up command line argument parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/5/18 7:51 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> Parse command line options in order to set up the context in which we
> will scrub the filesystem.


> +static void __attribute__((noreturn))
> +usage(void)
> +{
> +	fprintf(stderr, _("Usage: %s [OPTIONS] mountpoint\n"), progname);
> +	fprintf(stderr, _("-a:\tStop after this many errors are found.\n"));
> +	fprintf(stderr, _("-b:\tBackground mode.\n"));

do you intentionally not document -d?
<same question for manpage>

> +	fprintf(stderr, _("-e:\tWhat to do if errors are found.\n"));
> +	fprintf(stderr, _("-m:\tPath to /etc/mtab.\n"));
> +	fprintf(stderr, _("-n:\tDry run.  Do not modify anything.\n"));
> +	fprintf(stderr, _("-T:\tDisplay timing/usage information.\n"));
> +	fprintf(stderr, _("-v:\tVerbose output.\n"));
> +	fprintf(stderr, _("-V:\tPrint version.\n"));
> +	fprintf(stderr, _("-x:\tScrub file data too.\n"));
> +	fprintf(stderr, _("-y:\tRepair all errors.\n"));
> +
> +	exit(16);
> +}

Could we make this more like xfs_repair usage() for consistency?

Usage: xfs_repair [options] device

Options:
  -f           The device is a file
  -L           Force log zeroing. Do this as a last resort.
  -l logdev    Specifies the device where the external log resides.
  -m maxmem    Maximum amount of memory to be used in megabytes.
  -n           No modify mode, just checks the filesystem for damage.
  -P           Disables prefetching.
  -r rtdev     Specifies the device where the realtime section resides.
  -v           Verbose output.
  -c subopts   Change filesystem parameters - use xfs_admin.
  -o subopts   Override default behaviour, refer to man page.
  -t interval  Reporting interval in seconds.
  -d           Repair dangerously.
  -V           Reports version and exits.

so maybe:

Usage: xfs_scrub [options] mountpoint

  -a count	Stop after this many errors are found.
  -b		Background mode.
  -C fd		Print progress information to this fd.
  -e behavior	What to do if errors are found. (shutdown|continue)
  -m path	Path to /etc/mtab.
  -n		Dry run.  Do not modify anything.
  -T		Display timing/usage information.
  -v		Verbose output.
  -V		Reports version and exits.
  -x		Scrub file data too.
  -y		Repair all errors.
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux