Skip to content

Commit

Permalink
Accept cmd_args at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Simatwa committed Jan 14, 2024
1 parent 595f95d commit 4070809
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions WebChatGPT/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def output_bond(
with open(save_to, "a") as fh:
json.dump(text, fh, indent=4)
click.secho(f"Successfuly saved to `{save_to}`", fg="green")

def do_h(self, line):
"""Show help info in tabular format"""
table = Table(
Expand All @@ -302,7 +302,7 @@ def do_h(self, line):
)
Console().print(table)
click.secho(f"Submit any bug at : {__repo__}/issues/new", fg="yellow")

@busy_bar.run(help="Ensure conversation ID is correct")
def do_history(self, line):
"""Show conversation history"""
Expand Down Expand Up @@ -866,11 +866,12 @@ def generate(


@error_handler(exit_on_error=True)
def main():
def main(*cmd_args):
sys.argv += list(cmd_args)
dotenv.load_dotenv(os.path.join(os.getcwd(), ".env"))
args = sys.argv
if len(args) > 1 and args[1] in ("-v", "--version"):
print(f"webchatgpt {__version__}")
print(f"webchatgpt v{__version__}")
sys.exit(0)
elif (
len(args) > 1
Expand Down

0 comments on commit 4070809

Please sign in to comment.