Skip to content

Commit

Permalink
docs: update readme and command line options
Browse files Browse the repository at this point in the history
  • Loading branch information
Yazawazi committed Nov 2, 2023
1 parent 79fee7d commit 83b36e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down
14 changes: 8 additions & 6 deletions backend/funix/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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,
Expand All @@ -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.'
)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 83b36e6

Please sign in to comment.