fix lint errors (line length, unused var, nested if)
This commit is contained in:
9
fpaste
9
fpaste
@@ -722,7 +722,6 @@ def main():
|
||||
# Pre-process arguments: if first positional looks like a file, insert "create"
|
||||
args_to_parse = sys.argv[1:]
|
||||
commands = {"create", "c", "new", "get", "g", "delete", "d", "rm", "info", "i", "cert", "pki"}
|
||||
top_level_opts = {"-s", "--server", "-h", "--help"}
|
||||
|
||||
# Find insertion point for "create" command
|
||||
insert_pos = 0
|
||||
@@ -753,11 +752,9 @@ def main():
|
||||
break
|
||||
i += 1
|
||||
|
||||
# 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")
|
||||
# Insert "create" if no command found and we have input (file path or piped stdin)
|
||||
if not has_command and (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