Feedback required - new arguments parsing for rdiff-backup

"Eric L. Zolf" <[email protected]>
Newsgroups gmane.comp.sysutils.backup.rdiff-backup.general
Organization Rdiff-Backup
Message-ID <[email protected]>
Hello everybody,

first, let me wish you a happy new year, health and good luck.

I'm currently working on using argparse to improve the way command line 
arguments are parsed, in a way compatible with the old handling while 
developing a new, hopefully more logical and easier to extend, approach.

The attached script is a proof-of-concept, faking the interface and 
printing the result (without any real action), for which I'd like to get 
feedback, especially regarding your daily use of rdiff-backup:

1. is the compatible interface really similar to the old command line?
2. is the output using the old and new interfaces the same? (ignoring 
"null" default values)
3. how do you like the new interface? any feedback is welcome.

Few more notes to get you started:

`python3 arguments.py --help` gives you the old interface
`python3 arguments.py --new --help` gives you the new one
the new interface makes more clearly the difference between actions 
(backup, restore, compare, etc...) and options, e.g. the old 
`rdiff-backup -b dir1 dir2` becomes `rdiff-backup backup dir1 dir2`.
A neat trick of the new interface is the ability to create arguments 
files, e.g. restore.txt with one argument per line:

restore
--at
3B
repository_dir
target_dir

and use it on the command line with `python3 arguments.py @restore.txt`

I find that filtering away the null values helps to understand the 
output, e.g. with `| grep -v null`.

Hope you like it, let me know in both cases :-)

Thanks, Eric
arguments.py.gz (application/gzip, 7.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.