mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-27 16:29:41 -05:00
Merge pull request #1026 from micahflee/992_website_misc
Validate filenames in CLI for website mode
This commit is contained in:
commit
e35255861f
@ -88,13 +88,14 @@ def main(cwd=None):
|
||||
else:
|
||||
mode = 'share'
|
||||
|
||||
# Make sure filenames given if not using receiver mode
|
||||
if mode == 'share' and len(filenames) == 0:
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
# In share an website mode, you must supply a list of filenames
|
||||
if mode == 'share' or mode == 'website':
|
||||
# Make sure filenames given if not using receiver mode
|
||||
if len(filenames) == 0:
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
|
||||
# Validate filenames
|
||||
if mode == 'share':
|
||||
# Validate filenames
|
||||
valid = True
|
||||
for filename in filenames:
|
||||
if not os.path.isfile(filename) and not os.path.isdir(filename):
|
||||
|
Loading…
Reference in New Issue
Block a user