Skip to content

Commit

Permalink
move a few flags out of global
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed Sep 19, 2023
1 parent 9f014bc commit efdedc3
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions core/dbt/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ def global_flags(func):
@p.fail_fast
@p.log_cache_events
@p.log_file_max_bytes
@p.log_format
@p.log_format_file
@p.log_level
@p.log_level_file
Expand All @@ -150,8 +149,6 @@ def global_flags(func):
@p.use_experimental_parser
@p.version
@p.version_check
@p.warn_error
@p.warn_error_options
@p.write_json
@functools.wraps(func)
def wrapper(*args, **kwargs):
Expand All @@ -167,8 +164,11 @@ def wrapper(*args, **kwargs):
no_args_is_help=True,
epilog="Specify one of these sub-commands and you can find more help from there.",
)
@global_flags
@click.pass_context
@global_flags
@p.warn_error
@p.warn_error_options
@p.log_format
def cli(ctx, **kwargs):
"""An ELT tool for managing your SQL transformations and data models.
For more documentation on these commands, visit: docs.getdbt.com
Expand All @@ -177,8 +177,8 @@ def cli(ctx, **kwargs):

# dbt build
@cli.command("build")
@global_flags
@click.pass_context
@global_flags
@p.defer
@p.deprecated_defer
@p.exclude
Expand Down Expand Up @@ -295,8 +295,8 @@ def docs_generate(ctx, **kwargs):

# dbt docs serve
@docs.command("serve")
@global_flags
@click.pass_context
@global_flags
@p.browser
@p.port
@p.profile
Expand Down Expand Up @@ -324,8 +324,8 @@ def docs_serve(ctx, **kwargs):

# dbt compile
@cli.command("compile")
@global_flags
@click.pass_context
@global_flags
@p.defer
@p.deprecated_defer
@p.exclude
Expand Down Expand Up @@ -371,8 +371,8 @@ def compile(ctx, **kwargs):

# dbt show
@cli.command("show")
@global_flags
@click.pass_context
@global_flags
@p.defer
@p.deprecated_defer
@p.exclude
Expand Down Expand Up @@ -418,8 +418,8 @@ def show(ctx, **kwargs):

# dbt debug
@cli.command("debug")
@global_flags
@click.pass_context
@global_flags
@p.debug_connection
@p.config_dir
@p.profile
Expand All @@ -444,8 +444,8 @@ def debug(ctx, **kwargs):

# dbt deps
@cli.command("deps")
@global_flags
@click.pass_context
@global_flags
@p.profile
@p.profiles_dir_exists_false
@p.project_dir
Expand All @@ -465,8 +465,8 @@ def deps(ctx, **kwargs):

# dbt init
@cli.command("init")
@global_flags
@click.pass_context
@global_flags
# for backwards compatibility, accept 'project_name' as an optional positional argument
@click.argument("project_name", required=False)
@p.profile
Expand All @@ -488,8 +488,8 @@ def init(ctx, **kwargs):

# dbt list
@cli.command("list")
@global_flags
@click.pass_context
@global_flags
@p.exclude
@p.indirect_selection
@p.models
Expand Down Expand Up @@ -534,8 +534,8 @@ def list(ctx, **kwargs):

# dbt parse
@cli.command("parse")
@global_flags
@click.pass_context
@global_flags
@p.profile
@p.profiles_dir
@p.project_dir
Expand All @@ -558,8 +558,8 @@ def parse(ctx, **kwargs):

# dbt run
@cli.command("run")
@global_flags
@click.pass_context
@global_flags
@p.defer
@p.deprecated_defer
@p.favor_state
Expand Down Expand Up @@ -599,8 +599,8 @@ def run(ctx, **kwargs):

# dbt retry
@cli.command("retry")
@global_flags
@click.pass_context
@global_flags
@p.project_dir
@p.profiles_dir
@p.vars
Expand Down Expand Up @@ -629,8 +629,8 @@ def retry(ctx, **kwargs):

# dbt clone
@cli.command("clone")
@global_flags
@click.pass_context
@global_flags
@p.defer_state
@p.exclude
@p.full_refresh
Expand Down Expand Up @@ -666,8 +666,8 @@ def clone(ctx, **kwargs):

# dbt run operation
@cli.command("run-operation")
@global_flags
@click.pass_context
@global_flags
@click.argument("macro")
@p.args
@p.profile
Expand Down Expand Up @@ -698,8 +698,8 @@ def run_operation(ctx, **kwargs):

# dbt seed
@cli.command("seed")
@global_flags
@click.pass_context
@global_flags
@p.exclude
@p.full_refresh
@p.profile
Expand Down Expand Up @@ -735,8 +735,8 @@ def seed(ctx, **kwargs):

# dbt snapshot
@cli.command("snapshot")
@global_flags
@click.pass_context
@global_flags
@p.defer
@p.deprecated_defer
@p.exclude
Expand Down Expand Up @@ -775,16 +775,16 @@ def snapshot(ctx, **kwargs):

# dbt source
@cli.group()
@global_flags
@click.pass_context
@global_flags
def source(ctx, **kwargs):
"""Manage your project's sources"""


# dbt source freshness
@source.command("freshness")
@global_flags
@click.pass_context
@global_flags
@p.exclude
@p.output_path # TODO: Is this ok to re-use? We have three different output params, how much can we consolidate?
@p.profile
Expand Down Expand Up @@ -826,8 +826,8 @@ def freshness(ctx, **kwargs):

# dbt test
@cli.command("test")
@global_flags
@click.pass_context
@global_flags
@p.defer
@p.deprecated_defer
@p.exclude
Expand Down

0 comments on commit efdedc3

Please sign in to comment.