hrrmsn / ffcleaner

cmd tool to cleanup littered directories (Files&Folders cleaner)
0 stars 0 forks source link

Incorrect action when launching script with invalid arguments #37

Open hrrmsn opened 7 years ago

hrrmsn commented 7 years ago

It's looks like something strange.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py -logpath
Dir to output: ''.
Dir to clean: '-logpath'.
Error: dir to clean doesn't exist.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py a
Dir to output: ''.
Dir to clean: 'a'.
Error: dir to clean doesn't exist.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py b f
Error: must specify only one dir to clean.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py b f b
Error: must specify only one dir to clean.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py
Usage: [--todir dir] dir.
Usage: --logpath.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py -
Dir to output: ''.
Dir to clean: '-'.
Error: dir to clean doesn't exist.

Example of the expected reaction.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py -logpath
Error: unsupported option.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py a
Error: invalid argument.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py b f
Error: must specify '--todir' option.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py b f b
Error: must specify '--todir' option. (Or invalid arguments.)

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py
Usage: [--todir dir] dir.
Usage: --logpath.

E:\!Plan9\dev\languages\python\ffcleaner>ffcleaner.py -
Error: invalid argument.