forked from claw/flaskpaste
fpaste: fix -E flag with piped stdin
This commit is contained in:
8
fpaste
8
fpaste
@@ -753,9 +753,11 @@ def main():
|
||||
break
|
||||
i += 1
|
||||
|
||||
# Insert "create" before file path if no command found
|
||||
if not has_command and file_pos >= 0:
|
||||
args_to_parse.insert(insert_pos, "create")
|
||||
# Insert "create" if no command found and we have input
|
||||
# (either a file path or piped stdin)
|
||||
if not has_command:
|
||||
if file_pos >= 0 or not sys.stdin.isatty():
|
||||
args_to_parse.insert(insert_pos, "create")
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="fpaste",
|
||||
|
||||
Reference in New Issue
Block a user