print full help instead of usage
This commit is contained in:
parent
82f848f659
commit
df5fe4e07a
13
README.md
13
README.md
@ -41,7 +41,7 @@ chkbit will
|
||||
Run `chkbit PATH` to verify only.
|
||||
|
||||
```
|
||||
usage: chkbit.py [-h] [-u] [-f] [-q] [-v] PATH [PATH ...]
|
||||
usage: chkbit.py [-h] [-u] [-f] [-i] [-q] [-v] [PATH [PATH ...]]
|
||||
|
||||
Checks files for bitrot. See https://github.com/laktak/chkbit-py
|
||||
|
||||
@ -49,11 +49,12 @@ positional arguments:
|
||||
PATH
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-u, --update update indices (without this chkbit will only verify files)
|
||||
-f, --force force update of damaged items
|
||||
-q, --quiet quiet, don't show progress/information
|
||||
-v, --verbose verbose output
|
||||
-h, --help show this help message and exit
|
||||
-u, --update update indices (without this chkbit will only verify files)
|
||||
-f, --force force update of damaged items
|
||||
-i, --verify-index verify files in the index only (will not report new files)
|
||||
-q, --quiet quiet, don't show progress/information
|
||||
-v, --verbose verbose output
|
||||
|
||||
Status codes:
|
||||
ROT: error, bitrot detected
|
||||
|
@ -51,7 +51,7 @@ class Main:
|
||||
epilog=STATUS_CODES,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
)
|
||||
parser.add_argument("PATH", nargs="+")
|
||||
parser.add_argument("PATH", nargs="*")
|
||||
|
||||
parser.add_argument(
|
||||
"-u",
|
||||
@ -88,6 +88,8 @@ class Main:
|
||||
self.args = parser.parse_args()
|
||||
self.verbose = self.args.verbose
|
||||
self.quiet = self.args.quiet
|
||||
if not self.args.PATH:
|
||||
parser.print_help()
|
||||
|
||||
def _res_worker(self):
|
||||
while True:
|
||||
@ -144,8 +146,9 @@ class Main:
|
||||
def main():
|
||||
try:
|
||||
m = Main()
|
||||
m.process()
|
||||
m.print_result()
|
||||
if m.args.PATH:
|
||||
m.process()
|
||||
m.print_result()
|
||||
except KeyboardInterrupt:
|
||||
print("abort")
|
||||
sys.exit(1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user