Page 1 of 1

0.6.15 Please shorten error help in case of invalid syntax

Posted: Sat Jun 30, 2012 12:40 pm
by Jari Aalto
If you make a mistake on command line, program outputs huge amount of information. Usually the mistake is just a typo that is easily correctable. The problem with the long output is that is causes scrolling your terminal and old commands are out of your current view.

It would be nice if a simple friendly message were outputted:

Invalid command "xxxx". please see option -h for help

Or

Invalid option "--some-option", please see option -h for help

Currently it looks like this:

Code: Select all

fsarchiver invalid-command
fsarchiver.c#308,process_cmdline(): [invalid-command] is not a valid command.
====> fsarchiver version 0.6.15 (2012-06-02) - http://www.fsarchiver.org <====
Distributed under the GPL v2 license (GNU General Public License v2).
 * usage: fsarchiver [<options>] <command> <archive> [<part1> [<part2> [...]]]
<commands>
 * savefs: save filesystems to an archive file (backup a partition to a file)
 * restfs: restore filesystems from an archive (overwrites the existing data)
 * savedir: save directories to the archive (similar to a compressed tarball)
 * restdir: restore data from an archive which is not based on a filesystem
 * archinfo: show information about an existing archive file and its contents
 * probe [detailed]: show list of filesystems detected on the disks
<options>
 -o: overwrite the archive if it already exists instead of failing
 -v: verbose mode (can be used several times to increase the level of details)
 -d: debug mode (can be used several times to increase the level of details)
 -A: allow to save a filesystem which is mounted in read-write (live backup)
 -a: allow running savefs when partition mounted without the acl/xattr options
 -e <pattern>: exclude files and directories that match that pattern
 -L <label>: set the label of the archive (comment about the contents)
 -z <level>: compression level from 1 (very fast)  to  9 (very good) default=3
 -s <mbsize>: split the archive into several files of <mbsize> megabytes each
 -j <count>: create more than one compression thread. useful on multi-core cpu
 -c <password>: encrypt/decrypt data in archive, "-c -" for interactive password
 -h: show help and information about how to use fsarchiver with examples
 -V: show program version and exit
<information>
 * Support included for: lzo=yes, lzma=yes
 * support for ntfs filesystems is unstable: don't use it for production.
====
Distributed under the GPL v2 license (GNU General Public License v2)