Skip to content

Commit

Permalink
reworked CLI help and doco to match
Browse files Browse the repository at this point in the history
  • Loading branch information
madmickstar committed Jan 7, 2017
1 parent a0f60af commit 914c1aa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,6 @@ $ pip install restorething

Usage
-----
In all of the following cases, if no hour is supplied the default time value is set to 12:00:00.

Restore closest file before 6am 15th August 2016, if no file is found `restorething` will look for the closet file after 6am 15th August 2016.
```bash
$ python -m restorething 20160815 -vd sync/.stversions -hr 6
```

Restore closest file after 6am 15th August 2016, if no file is found, no file will be restored.
```bash
$ python -m restorething 20160815 -vd sync/.stversions -hr 6 -a
```

Restore closest file before 6am 15th August 2016, if no file is found, no file will be restored.
```bash
$ python -m restorething 20160815 -vd sync/.stversions -hr 6 -b
```

Restore closest file no more than 10 hours before 6am 15th August 2016, if no file is found `restorething` will look for the closet file no more than 10 hours after 6am 15th August 2016.
```bash
$ python -m restorething 20160815 -vd sync/.stversions -hr 6 -pm 10
```

```bash
$ python -m restorething {date [ -hr {0-24} | -b | -a | -pm {int} | -vd {dir} | -rd {dir} | -dd {dir} | -df {filename} | -nf | -nd | -ic | -ns | [ -ff {string} | -fd {string} | -fb {path and filename} | -fa {path and filename}] | -d | --version]}
```
Expand All @@ -78,4 +56,29 @@ date | integer | YYYYMMDD | | Date to restore files, date will be used to find
-fb | string | -fb {absolute path of file} | disabled | Recovers a single version of a file matching the DIR and Filename
-fa | string | -fa {absolute path of file} | disabled | Recovers all versions of a file ignoring any date and times specified
-d | switch | -d | disabled | Enables debug output to console
--version | switch | --version | disabled | Displays version
--version | switch | --version | disabled | Displays version


Examples
--------
In all of the following cases, if no hour is supplied the default time value is set to 12:00:00.

Restore closest file before 6am 15th August 2016, if no file is found `restorething` will look for the closet file after 6am 15th August 2016.
```bash
$ python -m restorething 20160815 -hr 6 -vd sync/.stversions
```

Restore closest file after 6am 15th August 2016, if no file is found, no file will be restored.
```bash
$ python -m restorething 20160815 -hr 6 -a -vd sync/.stversions
```

Restore closest file before 6am 15th August 2016, if no file is found, no file will be restored.
```bash
$ python -m restorething 20160815 -hr 6 -b -vd sync/.stversions
```

Restore closest file no more than 10 hours before 6am 15th August 2016, if no file is found `restorething` will look for the closet file no more than 10 hours after 6am 15th August 2016.
```bash
$ python -m restorething 20160815 -hr 6 -pm 10 -vd sync/.stversions
```
12 changes: 4 additions & 8 deletions restorething/restorething.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,12 @@ def process_cli(working_dir, version):
description='''Restore tool for syncthing''',
epilog='''Command line examples \n\n \
POSIX Users \n \
python -m restorething 20160815 -vd sync/.stversions -hr 6 \n \
python -m restorething 20160815 -vd sync/.stversions -hr 6 -a \n \
python -m restorething 20160815 -vd sync/.stversions -hr 6 -b \n \
python -m restorething 20160815 -vd sync/.stversions -hr 6 -pm 10 -ns -rd test \n \
python -m restorething 20160815 -hr 6 -vd sync/.stversions \n \
python -m restorething 20160815 -hr 6 -pm 10 -vd sync/.stversions -ns -rd test \n \
\n \
Windows Users \n \
python -m restorething 20160815 -vd sync\\.stversions -hr 6 \n \
python -m restorething 20160815 -vd sync\\.stversions -hr 6 -a \n \
python -m restorething 20160815 -vd sync\\.stversions -hr 6 -b \n \
python -m restorething 20160815 -vd sync\\.stversions -hr 6 -pm 10 -ns -rd test''',
python -m restorething 20160815 -hr 6 -vd sync\\.stversions \n \
python -m restorething 20160815 -hr 6 -pm 10 -vd sync\\.stversions -ns -rd test''',
formatter_class=RawTextHelpFormatter)
g1 = parser.add_mutually_exclusive_group()
g2 = parser.add_mutually_exclusive_group()
Expand Down

0 comments on commit 914c1aa

Please sign in to comment.