docs: add missing help text for commands (#19039)

closes https://github.com/frappe/frappe/issues/19036

[skip ci]
This commit is contained in:
Ankush Menat 2022-11-29 16:01:25 +05:30 committed by GitHub
parent c46c1e66d7
commit 5d1444c21c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 2 deletions

View file

@ -112,7 +112,7 @@ def get_commands():
from .translate import commands as translate_commands
from .utils import commands as utils_commands
clickable_link = "\x1b]8;;https://frappeframework.com/docs\afrappeframework.com\x1b]8;;\a"
clickable_link = "https://frappeframework.com/docs"
all_commands = (
scheduler_commands + site_commands + translate_commands + utils_commands + redis_commands
)

View file

@ -77,6 +77,7 @@ def disable_scheduler(context):
@click.argument("state", type=click.Choice(["pause", "resume", "disable", "enable"]))
@pass_context
def scheduler(context, state, site=None):
"""Control scheduler state."""
import frappe.utils.scheduler
from frappe.installer import update_site_config
@ -110,6 +111,7 @@ def scheduler(context, state, site=None):
@click.argument("state", type=click.Choice(["on", "off"]))
@pass_context
def set_maintenance_mode(context, state, site=None):
"""Put the site in maintenance mode for upgrades."""
from frappe.installer import update_site_config
if not site:
@ -172,6 +174,7 @@ def purge_jobs(site=None, queue=None, event=None):
@click.command("schedule")
def start_scheduler():
"""Start scheduler process which is responsible for enqueueing the scheduled job types."""
from frappe.utils.scheduler import start_scheduler
start_scheduler()
@ -196,6 +199,7 @@ def start_scheduler():
def start_worker(
queue, quiet=False, rq_username=None, rq_password=None, burst=False, strategy=None
):
"""Start a backgrond worker"""
from frappe.utils.background_jobs import start_worker
start_worker(

View file

@ -529,6 +529,7 @@ def add_user_for_sites(
@click.argument("email")
@pass_context
def disable_user(context, email):
"""Disable a user account on site."""
site = get_site(context)
with frappe.init_site(site):
frappe.connect()
@ -829,6 +830,7 @@ def drop_site(
force=False,
no_backup=False,
):
"""Remove a site from database and filesystem."""
_drop_site(site, db_root_username, db_root_password, archived_sites_path, force, no_backup)
@ -840,7 +842,6 @@ def _drop_site(
force=False,
no_backup=False,
):
"Remove site from database and filesystem"
from frappe.database import drop_user_and_database
from frappe.utils.backups import scheduled_backup
@ -1051,6 +1052,7 @@ def browse(context, site, user=None):
@click.command("start-recording")
@pass_context
def start_recording(context):
"""Start Frappe Recorder."""
import frappe.recorder
for site in context.sites:
@ -1064,6 +1066,7 @@ def start_recording(context):
@click.command("stop-recording")
@pass_context
def stop_recording(context):
"""Stop Frappe Recorder."""
import frappe.recorder
for site in context.sites:
@ -1080,6 +1083,7 @@ def stop_recording(context):
)
@pass_context
def start_ngrok(context, bind_tls):
"""Start a ngrok tunnel to your local development server."""
from pyngrok import ngrok
site = get_site(context)
@ -1103,6 +1107,7 @@ def start_ngrok(context, bind_tls):
@click.command("build-search-index")
@pass_context
def build_search_index(context):
"""Rebuild search index used by global search."""
from frappe.search.website_search import build_index_for_all_routes
site = get_site(context)
@ -1171,6 +1176,7 @@ def clear_log_table(context, doctype, days, no_backup):
@click.option("--no-backup", is_flag=True, default=False, help="Do not backup the site")
@pass_context
def trim_database(context, dry_run, format, no_backup):
"""Remove database tables for deleted DocTypes."""
if not context.sites:
raise SiteNotSpecifiedError
@ -1266,6 +1272,7 @@ def get_standard_tables():
@click.option("--no-backup", is_flag=True, default=False, help="Do not backup the site")
@pass_context
def trim_tables(context, dry_run, format, no_backup):
"""Remove columns from tables where fields are deleted from doctypes."""
if not context.sites:
raise SiteNotSpecifiedError

View file

@ -552,6 +552,7 @@ def _psql():
@click.command("jupyter")
@pass_context
def jupyter(context):
"""Start an interactive jupyter notebook"""
installed_packages = (
r.split("==")[0]
for r in subprocess.check_output([sys.executable, "-m", "pip", "freeze"], encoding="utf8")
@ -770,6 +771,7 @@ def run_tests(
failfast=False,
case=None,
):
"""Run python unit-tests"""
with CodeCoverage(coverage, app):
import frappe