diff --git a/README.md b/README.md index 9745b28d..8f16a62d 100644 --- a/README.md +++ b/README.md @@ -503,9 +503,7 @@ Our table widget uses advanced features in MUI Pro. If you have a MUI Pro licens ### Command line options ```text -usage: funix [-h] [-H 0.0.0.0] [-p 3000] [-F] [-B] [-l] [-R] [-P] [-d] [-t] - [-g None] [-r None] [-s None] [--version] - [file_or_module_name] +usage: funix [-h] [-H 0.0.0.0] [-p 3000] [-F] [-B] [-l] [-P] [-d] [-t] [-g None] [-r None] [-s None] [-D None] [--version] [file_folder_or_module_name] Funix: Building web apps without manually creating widgets @@ -518,11 +516,9 @@ Funix: Building web apps without manually creating widgets Visit us at http://funix.io positional arguments: - file_or_module_name The Python module containing functions to be turned - into web apps by Funix. For example, if your - functions are in the file `hello.py`, you should pass - `hello.py` here.if you want to turn a module called - `hello` into a web app, you should pass `hello` here. + file_folder_or_module_name + The Python module containing functions to be turned into web apps by Funix. For example, if your functions are in the file `hello.py`, you should pass `hello.py` here. if you want to turn a module called `hello` into a web app, you should pass `hello` + here, and with --package or -P flag. if you want to turn a full folder called `examples` into a web app, you should pass `examples` here. options: -h, --help show this help message and exit @@ -532,7 +528,6 @@ options: -F, --no-frontend Disable frontend server -B, --no-browser Disable auto open browser -l, --lazy Load functions without decorator - -R, --recursive Enable directory mode -P, --package Enable package mode -d, --dev Enable development mode -t, --transform Transform the globals to a session variables @@ -542,8 +537,9 @@ options: The directories in the repo that need to be used -s None, --secret None The secret key for the full app + -D None, --default None + The default function to run --version, -v show program's version number and exit - ``` The command `funix` above is equivalent to `python -m funix` if you have installed Funix. diff --git a/backend/funix/__main__.py b/backend/funix/__main__.py index e60fcb04..2c2cb0bc 100644 --- a/backend/funix/__main__.py +++ b/backend/funix/__main__.py @@ -8,10 +8,12 @@ @plac.pos( - "file_or_module_name", + "file_folder_or_module_name", "The Python module containing functions to be turned into web apps by Funix. " - "For example, if your functions are in the file `hello.py`, you should pass `hello.py` here." - "if you want to turn a module called `hello` into a web app, you should pass `hello` here. ", + "For example, if your functions are in the file `hello.py`, you should pass `hello.py` here. " + "if you want to turn a module called `hello` into a web app, you should pass `hello` here, " + "and with --package or -P flag. " + "if you want to turn a full folder called `examples` into a web app, you should pass `examples` here.", ) @plac.opt("host", "Host of Funix", abbrev="H") @plac.opt("port", "Port of Funix", abbrev="p") @@ -26,7 +28,7 @@ @plac.opt("secret", "The secret key for the full app", abbrev="s") @plac.opt("default", "The default function to run", abbrev="D") def main( - file_or_module_name=None, + file_folder_or_module_name=None, host="0.0.0.0", port=3000, no_frontend=False, @@ -50,7 +52,7 @@ def main( Just write your core logic and leave the rest to Funix. Visit us at http://funix.io""" - if not file_or_module_name and not from_git: + if not file_folder_or_module_name and not from_git: print( 'Error: No Python module, file or git repo provided.\nPlease run "funix --help" for more information.' ) @@ -84,7 +86,7 @@ def main( run( host=parsed_host, port=parsed_port, - file_or_module_name=file_or_module_name, + file_or_module_name=file_folder_or_module_name, no_frontend=parsed_no_frontend, no_browser=parsed_no_browser, lazy=parsed_lazy,