mirror of
https://github.com/frappe/bench.git
synced 2025-01-27 00:08:24 +00:00
fix: Add support for options on bench main group
Options like --use-feature, --version are tested and support maintained by the changes defined in this commit
This commit is contained in:
parent
a6f196440a
commit
8a0b78451b
27
bench/cli.py
27
bench/cli.py
@ -109,20 +109,31 @@ def cli():
|
|||||||
):
|
):
|
||||||
log("Command not being executed in bench directory", level=3)
|
log("Command not being executed in bench directory", level=3)
|
||||||
|
|
||||||
if in_bench and len(sys.argv) > 1:
|
if len(sys.argv) == 1 or sys.argv[1] == "--help":
|
||||||
if sys.argv[1] == "--help":
|
print(click.Context(bench_command).get_help())
|
||||||
print(click.Context(bench_command).get_help())
|
if in_bench:
|
||||||
print(get_frappe_help())
|
print(get_frappe_help())
|
||||||
return
|
return
|
||||||
|
|
||||||
if cmd_from_sys in bench_command.commands:
|
_opts = [x.opts + x.secondary_opts for x in bench_command.params]
|
||||||
with execute_cmd(check_for_update=not is_cli_command, command=command, logger=logger):
|
opts = {item for sublist in _opts for item in sublist}
|
||||||
bench_command()
|
|
||||||
elif cmd_from_sys in get_frappe_commands():
|
# handle usages like `--use-feature='feat-x'` and `--use-feature 'feat-x'`
|
||||||
|
if cmd_from_sys and cmd_from_sys.split("=", 1)[0].strip() in opts:
|
||||||
|
bench_command()
|
||||||
|
|
||||||
|
if cmd_from_sys in bench_command.commands:
|
||||||
|
with execute_cmd(check_for_update=not is_cli_command, command=command, logger=logger):
|
||||||
|
bench_command()
|
||||||
|
|
||||||
|
if in_bench:
|
||||||
|
if cmd_from_sys in get_frappe_commands():
|
||||||
frappe_cmd()
|
frappe_cmd()
|
||||||
else:
|
else:
|
||||||
app_cmd()
|
app_cmd()
|
||||||
|
|
||||||
|
bench_command()
|
||||||
|
|
||||||
|
|
||||||
def check_uid():
|
def check_uid():
|
||||||
if cmd_requires_root() and not is_root():
|
if cmd_requires_root() and not is_root():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user