Skip to content

Commit

Permalink
Improve the help text text
Browse files Browse the repository at this point in the history
Add "(leave blank for 'default')." or
"(leave blank for all organizations)" to organization options.
Remove the text "This commands assume single organization operation."
from the `users` and `groups` managers help text.
  • Loading branch information
adamlwgriffiths committed Jun 19, 2016
1 parent 704a167 commit 15361cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions redash/cli/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
manager = Manager(help="Data sources management commands.")


@manager.option('--org', dest='organization', default=None, help="The organization the user belongs to")
@manager.option('--org', dest='organization', default=None, help="The organization the user belongs to (leave blank for all organizations).")
def list(organization=None):
"""List currently configured data sources."""
if organization:
Expand All @@ -32,7 +32,7 @@ def validate_data_source_type(type):
@manager.option('name', default=None, help="name of data source to create")
@manager.option('--type', dest='type', default=None, help="new type for the data source")
@manager.option('--options', dest='options', default=None, help="updated options for the data source")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to (leave blank for 'default').")
def new(name=None, type=None, options=None, organization='default'):
"""Create new data source."""
if name is None:
Expand Down Expand Up @@ -97,7 +97,7 @@ def new(name=None, type=None, options=None, organization='default'):


@manager.option('name', default=None, help="name of data source to delete")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to (leave blank for 'default').")
def delete(name, organization='default'):
"""Delete data source by name."""
try:
Expand All @@ -123,7 +123,7 @@ def update_attr(obj, attr, new_value):
@manager.option('--name', dest='new_name', default=None, help="new name for the data source")
@manager.option('--options', dest='options', default=None, help="updated options for the data source")
@manager.option('--type', dest='type', default=None, help="new type for the data source")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to (leave blank for 'default').")
def edit(name, new_name=None, options=None, type=None, organization='default'):
"""Edit data source settings (name, options, type)."""
try:
Expand Down
4 changes: 2 additions & 2 deletions redash/cli/groups.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from flask_script import Manager, prompt_pass
from redash import models

manager = Manager(help="Groups management commands. This commands assume single organization operation.")
manager = Manager(help="Groups management commands.")

@manager.option('name', help="Group's name")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to (leave blank for 'default').")
@manager.option('--permissions', dest='permissions', default=None, help="Comma seperated list of permissions ('create_dashboard', 'create_query', 'edit_dashboard', 'edit_query', 'view_query', 'view_source', 'execute_query', 'list_users', 'schedule_query', 'list_dashboards', 'list_alerts', 'list_data_sources') (leave blank for default).")
def create(name, permissions=None, organization='default'):
print "Creating group (%s)..." % (name)
Expand Down
14 changes: 7 additions & 7 deletions redash/cli/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from redash import models
from redash.handlers.users import invite_user

manager = Manager(help="Users management commands. This commands assume single organization operation.")
manager = Manager(help="Users management commands.")


def build_groups(org, groups, is_admin):
Expand All @@ -22,7 +22,7 @@ def build_groups(org, groups, is_admin):
return groups

@manager.option('email', help="email address of the user to grant admin to")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to")
@manager.option('--org', dest='organization', default='default', help="the organization the user belongs to, (leave blank for 'default').")
def grant_admin(email, organization='default'):
try:
org = models.Organization.get_by_slug(organization)
Expand All @@ -42,7 +42,7 @@ def grant_admin(email, organization='default'):

@manager.option('email', help="User's email")
@manager.option('name', help="User's full name")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to (leave blank for 'default').")
@manager.option('--admin', dest='is_admin', action="store_true", default=False, help="set user as admin")
@manager.option('--google', dest='google_auth', action="store_true", default=False, help="user uses Google Auth to login")
@manager.option('--password', dest='password', default=None, help="Password for users who don't use Google Auth (leave blank for prompt).")
Expand All @@ -67,7 +67,7 @@ def create(email, name, groups, is_admin=False, google_auth=False, password=None


@manager.option('email', help="email address of user to delete")
@manager.option('--org', dest='organization', default=None, help="The organization the user belongs to")
@manager.option('--org', dest='organization', default=None, help="The organization the user belongs to (leave blank for all organizations).")
def delete(email, organization=None):
if organization:
org = models.Organization.get_by_slug(organization)
Expand All @@ -82,7 +82,7 @@ def delete(email, organization=None):

@manager.option('password', help="new password for the user")
@manager.option('email', help="email address of the user to change password for")
@manager.option('--org', dest='organization', default=None, help="The organization the user belongs to")
@manager.option('--org', dest='organization', default=None, help="The organization the user belongs to (leave blank for all organizations).")
def password(email, password, organization=None):
try:
if organization:
Expand All @@ -105,7 +105,7 @@ def password(email, password, organization=None):
@manager.option('email', help="The invitee's email")
@manager.option('name', help="The invitee's full name")
@manager.option('inviter_email', help="The email of the inviter")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to")
@manager.option('--org', dest='organization', default='default', help="The organization the user belongs to (leave blank for 'default')")
@manager.option('--admin', dest='is_admin', action="store_true", default=False, help="set user as admin")
@manager.option('--groups', dest='groups', default=None, help="Comma seperated list of groups (leave blank for default).")
def invite(email, name, inviter_email, groups, is_admin=False, organization='default'):
Expand All @@ -128,7 +128,7 @@ def invite(email, name, inviter_email, groups, is_admin=False, organization='def
print "The inviter [%s] was not found." % inviterEmail


@manager.option('--org', dest='organization', default=None, help="The organization the user belongs to")
@manager.option('--org', dest='organization', default=None, help="The organization the user belongs to (leave blank for all organizations)")
def list(organization=None):
"""List all users"""
if organization:
Expand Down

0 comments on commit 15361cc

Please sign in to comment.